Preloading featured image

Posted in: Newspaper
Post count: 57

Hello,

Can you suggest how to preload featuerd image on mobile theme and cloud/template for desktop?
I would like to avoid to use plugin for that.

Thank you

Post count: 21065

Hello @crodexter!

Unfortunately, there is no option for preloading the featured images. But, we will take in consideration your query.

Thank you for understanding!

Post count: 26

It’s been a while since I asked question.

Some time ago I found the hook that works on desktop.

add_action( ‘wp_head’, function(){
$featured_img_url = get_the_post_thumbnail_url(get_the_ID(),’full’);
echo ‘<link rel=”preload” as=”image” href=”‘.$featured_img_url.'”/>’;
});

Could you suggest what to use for
$featured_img_url = get_the_post_thumbnail_url(get_the_ID(),’full’);
for mobile theme?

Same hook does not work on mobile.
On desktop I got LCP of 0,6 seconds which is great and shows my hosting and cloudflare works

Post count: 21065

Hello @croboy !

Please note that the customization(code) will require custom work which is not covered by the support team.

Thank you so much for understanding!

Post count: 26

Hi Bettina,

Thank you for a quick replay.
I’d say this is not theme customization. This is SEO/speed optimization and in my option this should be integrated within theme on both desktop and mobile theme.
It improves LCP.
There is way to do it via plugin but I think it is better to avoid plugins for such small changes.

Post count: 24

Hello @croboy

May I know which plugin can fix LCP? Thank you

  • This reply was modified 2 years by fuenson.
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.