Thumbnail For Your WordPress 2.5 Posts

For a recent project of mine, I wanted my WordPress site to have posts listed on the front page, but wanted the option to include a unique thumbnail for each post that would sit pretty under the title.

I came across a nice tutorial after a little Google searching and found this great article on exactly how to do it.

It’s absolutely perfect, just that once you do this, all your posts need to have a thumbnail, otherwise there will be a missing placeholder where the thumb should be. In my case I wanted to have the ability to either use the feature or not to use it.

From using the foundation of Blogging Bits’ code, I just added a statement to check if the image has been added assigned to the post, and if not, the thumbnail code is ignored. If this is something you want to do, check out Blogging Bit’s tutorial, and if you want to add my modification for the option not to always need a thumb, here it is:

ID, "thumb", true);

if ($thumb != "")
{ ?>

" alt="" class="thumb" />

Remember, I’m not a professional PHP programmer myself but I’ve tested the code and it seems to work. Good luck, I hope it helps!

3 thoughts on “Thumbnail For Your WordPress 2.5 Posts

  1. Mike W

    Hi, David, Like this idea a lot. I want to have thumbs on my front page but is it possible to have them there and yet on a single page have the full size image there?

    Thanks and keep up the good work.

Comments are closed.