[Resolved] mobile menu issue

Home Forums Support [Resolved] mobile menu issue

Home Forums Support mobile menu issue

Viewing 10 posts - 16 through 25 (of 25 total)
  • Author
    Posts
  • #1438624
    el-mob

    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

    #1438733
    Elvin
    Staff
    Customer Support

    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.

    #1438735
    el-mob

    Hi

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

    #1438768
    Tom
    Lead Developer
    Lead Developer

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

    #1438776
    el-mob

    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 ?

    #1438779
    Tom
    Lead Developer
    Lead Developer

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

    #1438788
    el-mob
    #1438926
    David
    Staff
    Customer Support

    Yes the PHP in that document is correct.

    #1438933
    el-mob

    thanks, problem solved

    #1439008
    David
    Staff
    Customer Support

    Glad to hear that

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