Home Forums WoodMart support forum Disable lazy loading on certain pages

Disable lazy loading on certain pages

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #553429

    artwork
    Participant

    I’m using a multivendor plugin that doesn’t support lazy loading in the vendor dashboard. Is there any way I can disable woodmart lazy loading on the pages of this plugin?

    #553508

    Hello,

    Try to use the theme preset feature of our theme. Here is our documentation on how to use theme presets. https://xtemos.com/docs-topic/theme-settings-presets/

    Best Regards.

    #553577

    artwork
    Participant

    This doesn’t work because the Marketking Multivendor Plugin and Vendor Dashboard pages have their own layout and don’t use woodmart layouts. I tried to disable lazy loading using presets by page ID, that Marketking uses as the dashboard home page, but had no success.

    Perhaps you have some snippet to disable the lazy loading script on certain URLs.

    #553773

    Hello,

    Try to add the following PHP code snippet to the child theme function.php file to do this

    function woodmart_disable_lazy_on_page() {
        $current_page_id = get_queried_object_id();
        if ( ! $current_page_id ) {
            $current_page_id = get_the_ID();
        }
        $pages = [
            12036, 12037
        ];
        if ( in_array( $current_page_id, $pages ) ) {
            woodmart_lazy_loading_deinit( true );
        }
    }
    add_action( 'wp', 'woodmart_disable_lazy_on_page', 1000 );

    Remember one thing: vendor page ID must be used in this code so it only affects the vendor page not the others. You can use the page id in the $page array as I used 12036, 12037 just to set an example for you.

    Best Regards.

    #554000

    artwork
    Participant

    Solved, using a plugin hook and some of your code. Thank you.

    add_action('marketking_dashboard_head', function(){
    	woodmart_lazy_loading_deinit( true );
    });
    #554097

    Sounds Great! that your issue has been solved.

    I’m so happy to hear you are pleased with the Theme and Support. XTEMOS strives to deliver the best customer experience, and it makes our day to hear we have accomplished that.

    We count ourselves lucky to have you as a customer. You can always reach us at any time. We are always here to help you.

    Thanks for contacting us.
    Have a great day.

    Topic Closed.
    Best Regards.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Disable lazy loading on certain pages’ is closed to new replies.