Site logo

Archived topic

mobile menu issue

24 replies · Started by el-mob on September 8, 2020

Viewing posts 16–25 of 25

it working fine now because the lazyload on wp rocket is disabled so its defiantly a lazyload issue

when i activate it and place the code its not solving the issue

i activated lazy load again so you can see where the issue is coming from

You can try again with the image src approach.

You can try this PHP code.

add_filter( 'rocket_lazyload_excluded_src', function( $src ) {
     $src[] = 'bullyshoplogo';
     return $src;
 } );

The 'bullyshoplogo' came from the file name of your logo taken from site inspection. If you happen to change its file name in the future, please change this value on the PHP code too.

Also, Please make sure the code is properly copied/pasted as it is. Adding extra ';' or any PHP syntax will cause issues.

Hi

it didn't fix it
there is any other way?

Is WP Rocket enabled at the moment? I'm not able to see the issue right now.

Hi I found this

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

Now its working fine Thanks

just one more question? there unesecery code here ?

Not really sure what that code is doing that isn't done by default. Where'd you find it?

Yes the PHP in that document is correct.

thanks, problem solved

Glad to hear that

This archived topic is closed to new replies.