Site logo

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

Home Forums Support [Resolved] Is possible to set an icon (icomoon) like logo image?

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

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1271900
    Alfonso

    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!

    #1272430
    Leo
    Staff
    Customer Support

    Hi there,

    Are you actually referring to the logo here? If so something like this might help:
    https://css-tricks.com/change-color-of-svg-on-hover/

    #1272519
    Alfonso

    Im referrig to my logo here:

    https://desa.delahuertacasa.com

    Im tried it following your link but not understand how can do it, sorry

    #1272530
    Leo
    Staff
    Customer Support

    So basically you want the logo color to change on hover?

    If so you might need to go with 2 logos images with different colors and the method here:
    https://generatepress.com/forums/topic/logo-hover/#post-83213

    Just use Hooks Elements instead of GP hooks:
    https://docs.generatepress.com/article/hooks-element-overview/

    #1272537
    Alfonso

    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?

    #1272920
    Tom
    Lead Developer
    Lead Developer

    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.

    #1273119
    Alfonso

    Thanks Tom!

    #1274120
    Tom
    Lead Developer
    Lead Developer

    No problem 🙂

    #1291683
    Alfonso

    Resolved!

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.