Site icon Catch Themes

Preload Image

Hello, I want to preload a slider image but only on the front page. I have inserted some code into the header.php file and placed it in the child theme, and it is preloading the image. This works well. However, it preloads the image on every page. I only want it to preload on the front page. Can you assist me to wrap the link tag with a php if condition? The website is iglobal.net and the link tag I am using is: <link rel='preload' href='/wp-content/uploads/2020/07/Playa-Hermosa-014-Home-Page.jpg' as='image'> Thank you!
Exit mobile version