I'm trying to load an image using bloginfo('template_directory')
My code:
<img style="max-height: 500px" src="<?php bloginfo('template_directory'); ?>/assets/home-image.png" />
The assets folder is inside my theme folder.
It works perfectly in my localhost.
But when I upload the code to my server I doesn't show the image.
When I inspect the element, here what it shows:
<img style="max-height: 500px" src="data:image/svg xml," data-lazy-src="https://www.mywebsite.com/wp-content/themes/mytheme/assets/home-image.png">
Any guess?
CodePudding user response:
Okay. I figured out that WP Rocket plugin was the problem. I had to disable the cache for imagens into the settings of that plugin.