Add custom SVG icons to Social Icon MENU in WordPress Twenty Seventeen Child Theme

You don’t need to copy the inc/icon-functions.php file and include/require it from the child theme — remember that the parent theme will also load the same file/functions and that would result in a PHP error if you did not rename the functions in the copied file. So try these: (You’ve already done this properly, as … Read more

Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons

Ok, this is what I did: First, I replicated classes/class-twentynineteen-svg-icons.php to the child theme. Renamed to class-mytheme-svg-icons.php. Added a extend with my New_SVG_Icons class: class New_SVG_Icons extends TwentyNineteen_SVG_Icons { /** * Gets the SVG code for a given icon. */ public static function get_svg( $group, $icon, $size ) { if ( ‘ui’ == $group ) … Read more

How to Include SVG sprites icons into the body tag? [closed]

It’s because that’s not how you should include an SVG in PHP, include_once is used for including PHP files. Reason behind this error: PHP Parse error: syntax error, unexpected version (T_STRING) is that PHP was unable to parse the beginning of the SVG file at the point where the XML version was defined: <?xml version=”1.0″ … Read more

Escaping SVG with KSES

Found your question as I was searching for an answer. I tried experimenting a bit more with wp_kses and found that lower-casing viewbox in the arguments seems to fix the issue. You don’t have to put the actual attribute on the SVG in lowercase, just the wp_kses() argument. This may be more than you need, … Read more