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?

有帮助吗?

解决方案

<img src="<?php bloginfo('template_url'); ?>/img/logo-apptivation.jpg?t=<?php echo time(); ?>"/>

其他提示

<img src="<?php echo sprintf('%s/img/logo-apptivation.jpg?%s', 
                             bloginfo('template_url'),time());?>"/>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top