• Resolved piergio1

    (@piergio1)


    Hi,

    I found the “LCP Image to preload” a great solution. But it isn’t available for products. Maybe I’m missing something? How can I activate it?

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

    (@optimizingmatters)

    had not tried this myself yet, but below code snippet should accomplish this @piergio1 ;

    
    add_filter( 'autoptimize_filter_metabox_screens', function( $screens ) {
        $screens[] = 'product';
        return $screens;
    }, 10, 1 );

    hope this helps,
    frank

    Thread Starter piergio1

    (@piergio1)

    Great! I have to put this code in the functions.php file?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    that should work yes, or you can use something like the code snippets plugin.

    Thread Starter piergio1

    (@piergio1)

    I put this on functions.php and the option appeared in the products!

    Unluckly, I test the lighthouse test (after I choose the lcp product image to preload) and it didn’t preload it.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Maybe first of all make sure to clear the page cache. After that take a look at the HTML source to check if the link-preload tag for the image is present maybe?

    Thread Starter piergio1

    (@piergio1)

    I empty Autoptimize and Cloudflare cache… I searched in the Inspection tab but no “pre-load” appears. Maybe it’s a problem in the theme. Thank you anyway

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    can you share the URL of a product page which has an LCP image defined?

    Thread Starter piergio1

    (@piergio1)

    Hi,

    I discover that the problem was on the theme code. Because the preload worked, but the image was into a gallery. So the gallery loaded very very late.

    Thank you!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’re welcome, feel free to leave a review of the plugin and support here! 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.