Home Forums WoodMart support forum Disable Lazy Load Snippet

Disable Lazy Load Snippet

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

    newsprince
    Participant

    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

    Artem Temos
    Keymaster

    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
    Participant

    Yes excellent.

    Thank you very much!

    #138158

    Artem Temos
    Keymaster

    You are welcome.

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