Home Forums WoodMart – Premium Template Disable Lazy Load Snippet

This topic contains 3 replies, has 2 voices, and was last updated by Artem Temos Artem Temos 3 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #138127

    newsprince
    Staff

    Hello.

    Can you post a snippet to disable lazy load when the lazy load option is enabled so that we can disable lazy load on a particular page we want?

    Thank you.

    #138141

    Hi,

    Try to add the following PHP code snippet to the child theme functions.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 = [
            107, 108,
        ];
        if ( in_array( $current_page_id, $pages ) ) {
            woodmart_lazy_loading_deinit( true );
        }
    }
    add_action( 'wp', 'woodmart_disable_lazy_on_page', 1000 );

    Regards

    #138147

    newsprince
    Staff

    Yes excellent.

    Thank you very much!

    #138158

    You are welcome.

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

You must be logged in to reply to this topic.