Default Post thumbnails plugin

Featured

With the support for post thumbnails in WordPress 2.9 you can now display a thumbnail image for each post in your site, depending on the theme you are using and if you enabled support for post thumbnails for it.

But if your site already has hundreds of posts, adding a thumbnail image for each one will be a lot of work even if you only want the same image for each old post.

This plugin allows you to specify a default post thumbnail for posts that doesn’t have a thumbnail set.

This plugin requires that you have enabled support for post thumbnails in your theme (you can enable it by adding these 2 lines in your theme functions.php file).

if ( function_exists(‘add_theme_support’) ) {
add_theme_support(‘post-thumbnails’); }

You can select the thumbnail from the images already uploaded to your media library.

You can see more screenshots of this plugin, how to use it and the download link in the Default Post Thumbnails page

Preview short URL’s in comments

Yesterday Keith Dsouza wrote in Weblog Tools Collection about the problem with short url in comments which are used by spammers to try to get their comments approved.

The problem with short urls is that in order to know where the link points you have to click on it with the risk of being sent to a malware site or something else. Or you can use another web service to expand the URL and check the destination but you have to open another browser tab, copy the URL from the comment and paste it into the other tab.

Continue reading

Post thumbnails and default images

In my previous post about post thumbnails with posts excerpts I shared code to display the first image of your post as a thumbnail in your main page and it displayed a default image if the post didn’t have any images in it.

Now that WordPress 2.9 was released we can use new functions to display the post image as a thumbnail. This feature is only available if it is enabled specifically in the theme, so to enable it all you have to do is add this 2 lines to the functions.php file of your theme.

if ( function_exists(‘add_theme_support’) )
add_theme_support(‘post-thumbnails’);

This will enable the post thumbnail functionality and add a new box in your new post pages to set the post thumbnail

post_thumbnail_box

post_thumbnail_box2

To set an image as thumbnail you upload it like any other image or select it from your media library and at the bottom you will see the text “Use as thumbnail”, click on it and that’s it.

post_thumbnail_3

Now, to display the thumbnail in your theme you have to use the function the_post_thumbnail(),  the basic usage should be :


if ( current_theme_supports( 'post-thumbnails' ) )
the_post_thumbnail(array(100,100));

Which is pretty simple, and integrated  into the code we have from the previous post about thumbnails should look like this:


if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) {
the_post_thumbnail(array(100,100));
} else {
postimage(100,75,'image for: '.get_the_title(),'image');
}

WordPress 2.9 – Carmen

blue-mAfter a short beta testing WordPress 2.9 “Carmen” is out and available for download or you can use the automatic upgrade (Tools > Upgrade) .

This release is named in honor of the jazz vocalist Carmen McRae.

Some users have reported issues with this version and incompatibilities with some plugins (RSS, Cron and scheduled posts, pings). Is recommended that you do a full backup of your database before attempting the upgrade.

And if you find issues with your WordPress installation after uploading the files of this new version or with the automatic upgrade check this post at Semiologic that provides 3 patched files that solve some of the issues that most users are facing.

I think that WordPress to release version 2.9.1 in a few days to properly address this issues.