WordPress.com Popular Posts
[resolved] Code to add a tag for thumbnails (2 posts)

  1. jhodgson
    Posted 3 years ago #

    Hi guys, just added a bit of code to make a shortcut for displaying the post's thumbnail along with the link.

    I added this on line 335:

    // %post_thumbnail% by James C. Hodgson, Jr
             if ( FALSE !== strpos( $instance['format'], '%post_thumbnail' ) ) {
                // ...and take yo picture; i wanna get witcha. I won't cuss or hitcha!
                $thumb = get_the_post_thumbnail( $post['post_id'], 'thumbnail');
                $replace['%post_thumbnail%'] = $thumb;

    Not sure if it's helpful to anyone, but if it is, that's all there is to it.

    Any chance of this making it into the plugin?



  2. frasten
    Plugin Author

    Posted 3 years ago #

    Thank you for your idea. I've added this feature in 2.6.0, in a similar way.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress.com Popular Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic