php on page - get post thumbnail (1 post)

  1. jaydaviot
    Posted 3 years ago #

    I have used php in my sidebar widget to pull up the last 5 post thumbnails using the following code:

    <div class="recent-2">
    <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:

Topic Closed

This topic has been closed to new replies.

About this Topic