One of the new features in WordPress 2.9+ was support for the Post Thumbnail feature. Unfortunately, this doesn’t work by default and the function and code need to be added to the theme so that the feature is available. Once it is available, however, it is really super useful.
If you aren’t comfortable editing your template files, find someone who will do this for you. Some newer themes have this functionality already built in.
Add the following code to your functions.php file
<?php if ( function_exists( 'add_theme_support' ) ) add_theme_support( 'post-thumbnails' ); ?>
I recommend making a copy of the file before editing it – I’ve messed up my functions file plenty of times ;-)
- You will now see the Post Thumbnail box on your Edit/Add New post screen. It will be on the bottom right column.
- Click on Set thumbnail and you can upload an image the way that you normally do. Instead of clicking on the Insert Into Post button, click on the Use as Thumbnail link and then Save.
The image will be displayed in the Post Thumbnail box.
- You now have a Post Thumbnail image but it doesn’t show up on your site. The code needs to be added to the template file where you want it displayed.
The code is
<?php the_post_thumbnail(); ?>
- Currently I use the Thumbnails for Excerpts plugin to display a thumbnail image in my archives. I plan on adding the post thumbnail code and using the post thumbnail rather than being dependent on the plugin. I would add the code next to the code that displays the excerpt. Of course, since I have over 400 posts this will be quite an undertaking.
As I mentioned this will should already be available on newer themes. If you are using an older theme and want to use this feature, you will need to add the code manually.
photo credit: red twolips
Did you enjoy this article? I can assist you with your WordPress or Facebook project. Contact me and I will provide you with an estimate. You can also connect with me on Facebook or follow me on Twitter. If you are looking for Hosting, WordPress Theme, Newsletter or other recommendations, please view my detailed list.
11 Responses to “How to Add the Post Thumbnail Feature to your WordPress Installation”
- » Blog Archive » Still Setting Up Here
- How to Use Captions with WordPress Post Thumbnails | WordPress and Facebook Consultant | (Anti) Social Development