• Resolved jidwictut9

    (@jidwictut9)


    Hello,
    excluding images from lazy loading with filenames works fine.
    But I want to exclude classes from lazy loading.
    I would like to exclude the featured post image.
    I have excluded .wp-post-image but it does not work.
    The image is only visible when printing. But it is not displayed because it is lazy loaded. If lazy load is completely disabled (AO + WP) it is visible.
    CSS:
    @media print { .wp-post-image { display: block!important; } }
    .wp-post-image {display:none}

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    try wp-post-image (so without the dot), that should work ??

    Thread Starter jidwictut9

    (@jidwictut9)

    Hello,
    thanks for the quick reply.Without the point…..then it works with the classes ??
    But…….I did the following to disable WP Lazy Load:
    add_filter( ‘wp_lazy_loading_enabled’, ‘__return_false’ );
    That’s right isn’t it? But it doesn’t work for the featured image (I know this has nothing to do with AO) ??

    Do you know how to exclude images from lazy load in Elementor?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    no, afraid I don’t know for Elementor :-/

    if all else fails and if you’re somewhat into PHP coding, you could use the autoptimize_html_after_minify filter to remove the loading="lazy" occurrence maybe?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Lazy Loading-Exclude images by class does not work’ is closed to new replies.