'Why isn't my image un-caching? [closed]
I need an image to constantly be updated when the page is reloaded so I decided to put a number at the end of the path but for some reason my code keeps breaking the page:
<?php $t = getDate(); ?>
<img src="<?php bloginfo('template_url'); ?>/img/logo-apptivation.jpg?t=<?php .$t ?>"/>
Whats wrong?
Solution 1:[1]
<img src="<?php bloginfo('template_url'); ?>/img/logo-apptivation.jpg?t=<?php echo time(); ?>"/>
Solution 2:[2]
<img src="<?php printf('%s/img/logo-apptivation.jpg?%s',
bloginfo('template_url'),time());?>"/>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | lauriys |
| Solution 2 |
