Site logo

Archived topic

Icons

5 replies · Started by David on August 10, 2022

Viewing posts 1–6 of 6

How do we add icons now that none are included in the theme? The documentation is not clear. It just says SVG is standard. Are we supposed to load a set of SVG icons or add them one at a time? Why is there no basic set included?

Hi there,

in the past GP used to load the Font Awesome library for its themes icons eg. Hamburger, Search, Shopping cart etc.
Which carried an awfully high overhead, loading 100s of icons when the theme needs less than a dozen.

So we removed Font Awesome and replaced the theme icons with our own inline SVGs. Which are far more performant as there are no external resources to load and the additional HTML they require are counted in bytes.

If you want to add Icons in your content then you have several options via 3rd party plugins or code.

For example the FontAwesome plugin:

https://wordpress.org/plugins/font-awesome/

Or if you're using GenerateBlocks you can load any SVG into its Headline and Buttons Blocks, which will be inline ( so not external files to load ):

https://docs.generateblocks.com/article/adding-custom-svg-icons/

Thanks, David.
If you choose the GenerateBlocks method and add an SVG, would you have to add it each time you wanted to use it or would it be stored somewhere?

Hi David,

If you have GB pro, you can add the SVG to GB's asset library, it will be very easy to access.

But if you don't have GB pro, you'll need to store the SVG code somewhere else and enter the code each time.

Thanks, Ying!

You are welcome :)

This archived topic is closed to new replies.