Top

Daily Tip: Be Sure to Check If WordPress Has Support For Post Thumbnails When Building Themes

May 8, 2010

Post thumbnails were introduced in WordPress 2.9, but your users may be running an older version of WordPress. If you’re using post thumbnails in your theme, make sure to check if WordPress has support for them by adding something like this to your theme:

 if (function_exists('add_theme_support')) {
	add_theme_support('post-thumbnails');
	set_post_thumbnail_size(588, 250, true);
	add_image_size('loopThumb', 588, 125, true);
}

The next step is to check if there is a post thumbnail assigned to the post when adding the tags to your template. If not, you will want to display an image that is set via the custom fields. Credit for this tip and more information on adding post thumbnails to your themes can be found at: onextrapixel.com.

Tweet This Post

This theme is provided free of charge, provided you leave the "Wordpress Theme From Pressography.com" attribution link at the bottom of the theme.

If you want to remove the attribution link, you must pay a small, $10 license fee for each site on which you want to remove the link. Click Here For More Information

Comments

Got something to say?

Bottom
Article Archive  |  This site is a historical archive of pressography.com, a WordPress plugin and theme blog that published between 2006 and 2012. It is preserved for reference and is not operated by, affiliated with, or endorsed by its original authors. Nothing here is for sale and no form on this site is active. If you are the original owner and would like this domain returned, please get in touch.