[Resolved] Remove link from mobile header

Home Forums Support [Resolved] Remove link from mobile header

Home Forums Support Remove link from mobile header

  • This topic has 5 replies, 2 voices, and was last updated 5 years ago by Tom.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #830414
    Lucas

    Hi there,

    So this worked pretty well on Desktop: https://docs.generatepress.com/article/generate_logo_output/

    But I have mobile header activated. How can I remove the link from there too? Because on mobile the link persists.

    #830802
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Try this:

    add_filter( 'generate_mobile_header_logo_output', function() {
        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 mobile-header-logo">
                <img src="%1$s" alt="%2$s" />
             </div>',
             esc_url( apply_filters( 'generate_mobile_header_logo', $settings['mobile_header_logo'] ) ),
             esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) )
        );
    } );

    Let me know ๐Ÿ™‚

    #831037
    Lucas

    Hi there, thanks for the reply, but that didn’t work either.

    My menu lost the image: http://prntscr.com/mubj6a

    #831045
    Tom
    Lead Developer
    Lead Developer
    #831308
    Lucas

    Perfect, thanks.

    #831661
    Tom
    Lead Developer
    Lead Developer

    You’re welcome ๐Ÿ™‚

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