Fairweb

Développement WordPress, WordPress Mu, BuddyPress

screenshot-1

fw-post-image : use post thumbnails since WordPress 2.9 on existing blogs

| 0 comments

screenshot-1I have created the fw-post-image plugin which enables you to deal with post thumbnails since WordPress 2.9, even on your former posts. WordPress 2.9 has now a new feature that allows an image to be set as the image representing the post or page and be displayed as thumbnail (if your template is correctly set). However, for long existing blogs, it seems impossible to run through hundreds and sometimes thousands of post to set a thumbnail image. Here is what my plugin does :

  • if an image has been set as the post thumbnail according to the new WordPress 2.9 feature, it will be displayed.
  • if no post thumbnail is found, the plugin will look for the first image belonging to the post (uploaded from the post editor) and will display it.
  • if no image belonging to the post is found, the plugin will scan the content for an image and will display the first one it found.

The template tag the_post_thumbnail (core template tag in WP 2.9) can take two arguments : the size and attributes (classes etc…). These arguments are taken into account whatever the way the image was found.

Usage example :

<?php the_post_thumbnail('thumbnail', 'class=alignleft'); ?>

You will find more infos on the plugin page where you will be able to download it.

Attention ! This plugin only works with WordPress 2.9 or above !

Share

Author: Fairweb

Développement php/mysql, conception de sites internet

Leave a Reply

Required fields are marked *.

*