Site logo

Archived topic

Is possible to set an icon (icomoon) like logo image?

8 replies · Started by Alfonso on May 6, 2020

Viewing posts 1–9 of 9

I would like set an icon like logo image to change color on hover. Is it possible?

Else, i would be to change color on hover on svg logo image?

Thanks!

Hi,

may be a solution but this method makes to load 2 images logo on each time, is not possible to edit color on hover over unique svg file?

Hi there,

You would need to replace the logo with an inline SVG:

add_filter( 'generate_logo_output', function() {
    return sprintf( // WPCS: XSS ok, sanitization ok.
        '<div class="site-logo">
            <a href="%1$s" title="%2$s" rel="home">
                YOUR SVG HTML HERE
            </a>
         </div>',
         esc_url( apply_filters( 'generate_logo_href' , home_url( '/' ) ) ),
         esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) )
     );
} );

Then you can target the SVG element with CSS to color it.

Thanks Tom!

No problem :)

Resolved!

This archived topic is closed to new replies.