Home Forums WoodMart support forum prevent lazy load Reply To: prevent lazy load

#146245

Hello,

You can disable the lazy load feature for the checkout pages. 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 checkout page ID must be used in this code so it only affects the checkout 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.

You can see the check out page id when you edit the page. In your case checkout page id is “12036”.

Screenshot: https://jmp.sh/8KxVVcn

Best Regards.