WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. jhodgson
    Member
    Posted 2 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?

    Thanks!

    http://wordpress.org/extend/plugins/wordpresscom-popular-posts/

  2. frasten
    Member
    Plugin Author

    Posted 2 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

About this Topic