문제

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