[Resolved] Remove logo link

Home Forums Support [Resolved] Remove logo link

Home Forums Support Remove logo link

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #453119
    Nicholas

    Hi, I’d like to remove the link in the header logo completely. I saw another thread with instructions on how to change it, but what do I do if I want the link to be gone entirely? I just want the logo, no link. Thanks so much!

    #453190
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Check out the last example on this page: https://docs.generatepress.com/article/generate_logo_output/

    #453204
    Nicholas

    Ah, perfect! Thanks so much.

    #453420
    Tom
    Lead Developer
    Lead Developer

    You’re welcome! πŸ™‚

    #620494
    Joshua Vandercar

    This works for me. However, it serves up the standard logo. Is there a way to still serve up the retina logo on devices that could use it?

    #620783
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I just updated the code in the article – can you try now?

    Let me know πŸ™‚

    #620941
    Joshua Vandercar

    Fantastic. It works great now. Thank you!

    #621328
    Tom
    Lead Developer
    Lead Developer

    You’re welcome! πŸ™‚

    #621585
    Joshua Vandercar

    I’m back. I was trying to poke around with accomplishing this same thing with the generate_navigation_logo_output filter as I’m also using a sticky nav on the site, but couldn’t get it figured properly. Could anyone help me out with sorting that?

    #621637
    Tom
    Lead Developer
    Lead Developer

    Give this a shot:

    add_filter( 'generate_navigation_logo_output', 'tu_remove_nav_logo_link' );
    function tu_remove_nav_logo_link( $output ) {
        if ( ! function_exists( 'generate_menu_plus_get_defaults' ) ) {
            return $output;
        }
    
        $settings = wp_parse_args(
            get_option( 'generate_menu_plus_settings', array() ),
            generate_menu_plus_get_defaults()
        );
    
        return sprintf(
            '<div class="site-logo sticky-logo navigation-logo">
                <img class="header-image" src="%1$s" alt="%2$s" />
            </div>',
            esc_url( apply_filters( 'generate_navigation_logo', $settings['sticky_menu_logo'] ) ),
            esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) )
        );
    }
    #622144
    Joshua Vandercar

    Getting a broken image with that. I think $settings['sticky_menu_logo'] may need to be defined.

    #622170
    Tom
    Lead Developer
    Lead Developer

    Ah yea, you’re right. Just adjusted the code πŸ™‚

    #622240
    Joshua Vandercar

    Works most excellently now. Thank you!

    #622304
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

    #1256100
    Dominik

    Hi Tom,

    how can i remove the logo link on the page-hero?

    Thanks and best regards,
    Dominik

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