I have used php in my sidebar widget to pull up the last 5 post thumbnails using the following code:
<div class=”image”>[php] echo get_the_post_thumbnail( 1704, array(122,88), $attr ); [/php]</div>
<div class=”text”>[php] echo get_the_title(1704); [/php]</div>
<div class=”text2″>[php] echo get_the_time(‘F j, Y’, 1704); [/php]</div>
Everything works fine on my blog style homepage but the widget goes haywire on normal pages. If anyone can help me out it would be greatly appreciated.
My home page with php working in widget:
A page with php not working in widget:
- The topic ‘php on page – get post thumbnail’ is closed to new replies.