#130509 Preload post’s featured image

Landing Forums JupiterX WordPress Theme Preload post’s featured image

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Artak Arzumanyan

    Hi. I am trying to fix LCP issue for mobile and want to preload featured image, since its the LCP item. Don’t want to install plugin for that.
    There is a code here for preloading, but it preloads images with original names like full-bg2.jpg and since JupiterX in srcset uses file names like full-bg2-902e83e.jpg the code doesn’t make any change for LCP

    How can I modify the code or what other code can I use in my functions.php file to preload featured image.

    Thank you.

    Mohsin Al-Rabieai Support Team

    Hi Artak,

    There is this filter that can be used to remove the image resizing on the fly for the blog posts:

    add_filter('jupiterx_edit_post_image_medium_args', function(){ return false; },10 , 1);
    add_filter('jupiterx_edit_post_image_small_args', function(){ return false; },10 , 1);

    You may add these two to your child theme’s functions.php file. However, I am not sure if you are experiencing any other image resizing function on the theme. In fact, rather than these two, we don’t have any other place that we resize the images and add the parameter to the end of their URLs.

    Anyway, the best way to avoid LCP is to use WEBP images and use a good caching plugin such as WP-Rocket. It takes care about everything.

    Best regards

Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.