• Resolved thomastolkien

    (@thomastolkien)


    Hi – I’m trying to use this code to exclude lazy load on just tag archives:

    function deactivate_on_tag() {
    
    	// Disable LazyLoad for images on a 'tag' post type singular template.
    	if ( is_tag ) {
    		add_filter( 'do_rocket_lazyload', '__return_false' );
    		add_filter( 'do_rocket_lazyload_iframes', '__return_false' );
    	}
    }
    add_filter( 'wp', __NAMESPACE__ . '\deactivate_on_tag' );

    Although it does exclude the lazy load on taf archives, it also excludes / disables the lazy load on all archives, including the blog post page and front page.

    Is there any code that will target just the tag archives? Thanks.

Viewing 1 replies (of 1 total)
  • Plugin Contributor WP Rocket

    (@wp_rocket)

    Hi Thomas!

    Jorge from WP Rocket here. Thank you for taking the time to contact support.

    That’s because is_tag() function is being used. Try passing the Tag ID and so you can disable Lazyload only for that ID.

    Should you have any more questions or concerns please let me know and I’ll be more than happy to help you. Thank you for your time and patience. I hope you have a great day.

    Regards,

    • This reply was modified 4 years ago by WP Rocket.
Viewing 1 replies (of 1 total)
  • The topic ‘Is it possible to exclude lazy load on tag archives?’ is closed to new replies.