WP Favorite Posts
Thumbnails in widget (5 posts)

  1. CoastAMS
    Posted 3 years ago #

    This plugin is great, I'm using it with some custom posts and all works well, except...

    I would like to add a thumbnail to each Favorited item in the widget, i've tried the below code and although this displays an image - it displays the same thumbnail for every post.

    the_post_thumbnail( $thumbsize );
                echo "<a href='".get_permalink($o->post_id)."' title='". $p->post_title ."'>" . $p->post_title . "</a>($o->meta_value)</span>";

    any pointers or guidance would be really appreciated.


  2. CoastAMS
    Posted 3 years ago #

    I figured it out..
    just posting in case anyone else needs this:

    just add this line to widget code:

    echo get_the_post_thumbnail( $o->post_id, thumbnail);

  3. lildragn
    Posted 3 years ago #

    Cheers! Thanks for posting your solution, a lot of peeps don't :)

  4. joegti10
    Posted 3 years ago #

    ...where exactly in the 'widget code' did you place it?

  5. joegti10
    Posted 3 years ago #

    in the wp-favorite-posts.php around line 216 for anyone else looking.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Favorite Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic