Excerpt Thumbnails

January 2007


Description:
Displays the first image used inside a post as a thumbnail on a page that lists posts (inside the loop, such as archives, category pages, or any page that displays excerpts). If no images are found, nothing is displayed. You can set a few options such as randomly selecting an image from the post and setting custom CSS id/class or in-line styles.

Usage:
Upload exthumb.php into your plug-in folder and activate as usual. Then, inside the loop, place this piece of code where you want the thumbnail to appear:

<?php exthumb($post->ID, "style=\"float:right;\"", false); ?>

Options:
There are a few options you can pass along:

  • post_id” (required: $post->ID)
  • image_attributes” (example: “style=\”float:right;\”") Note that you’ll need to escape any double quotes you use with a back slash
  • sort_images_randomly” (true = will display a random image from inside the post. false = will display first image inside the post. Defaults to false.)

Download Download Excerpt Thumbnails (v1.0)

Share This

downloads · plugins

1 response so far ↓

  • icyone // Feb 19, 2008 at 9:51 pm

    Sorry I’m a total noobie…where do I put

    ID, “style=\”float:right;\”", false); ?>

    To have it show up in my archives. I see no place in the loop?

    Thanks for your time. It looks perfect for what i need

Leave a Comment