1) Create an image sprite – images/sprite-map.svg
2) Add this snippet to functions.php
// ========================================================================= // CUSTOM SVG LOGO // ========================================================================= remove_action( 'genesis_site_title', 'genesis_seo_site_title' ); function add_sprite_map(){ include('images/sprite-map.svg'); } add_action('genesis_before', 'add_sprite_map'); function add_svg_logo_to_header(){ if(is_front_page()){ echo ' <div id="site-logo"> <h1> <a href="'.home_url().'"> <svg class="svg-logo"> <use xlink:href="#YOUR_SVG_ID" /> </svg> </a> </h1> </div>'; } else{ echo ' <div id="site-logo"> <h4> <a href="'.home_url().'"> <svg class="svg-logo"> <use xlink:href="#YOUR_SVG_ID" /> </svg> </a> </h4> </div>'; } } add_action('genesis_site_title', 'add_svg_logo_to_header');
Leave a Reply