Use Your Theme’s SVG Icons in SuperSide Me

Among other things, SuperSide Me 2.4.0 brought SVG icons to the table. The plugin uses Font Awesome 5 (free) for the icons, but if you want to use your own icons (loaded in your theme), you can. If your theme SVG file(s) is/are already loaded, use this filter:

add_filter( 'supersideme_svg', 'leaven_prefer_theme_svg' );
/**
* Tell SuperSide Me not to load any icons.
* @param $args
*
* @return mixed
*/
function leaven_prefer_theme_svg( $args ) {
$args['styles'] = false;
return $args;
}

If you have a custom SVG sprite file in your theme and need to let SuperSide Me load it, you can use the filter this way instead (changing custom to the name of your .svg file (no extension needed) and path to where your file(s) is/are located):

add_filter( 'supersideme_svg', 'leaven_prefer_theme_svg' );
/**
* Let's load completely custom icons which aren't somehow otherwise being loaded.
* @param $args
*
* @return mixed
*/
function leaven_prefer_theme_svg( $args ) {
$args['styles'] = array( 'custom' );
$args['path'] = get_stylesheet_directory() . '/sprites';
return $args;
}

Note: if you use your own SVG files, please make sure that they do not include an opening line like this:

<!--?xml version="1.0" encoding="UTF-8"?-->

If they do, please delete that line.

Return to SuperSide Me
Bars Code Check chevron-down chevron-left chevron-right chevron-up Envelope Laptop Search Times Facebook GitHub Google Plus Instagram LinkedIn Pinterest Twitter WordPress Logo Wordpress Simple