Get Excerpt with Thumbnail Image – WordPress Plug-in

Get Excerpt with Thumbnail images is a simple wordpress plugin. It gives thumbnail image, excerpt and title of WordPress post, in the form PHP array. It is upto the developer how he can display these info on his web page.

Simple to use Get Excerpts with Thumbnail plugin uses meta data of wordpress post, to retrieve thumbnail image. It also uses another plug-in named Content Extract by Rob Shumann, to retrieve excerpt from POST. You need install Content Extract plugin before start working with this plugin.

Inspite of having found numerous plugins to get excerpts along with thumbnail images in WordPress plugin directory. I have written this plugin to reduce number of requests that are made to MySQL database while fetching data.

== Installation ==
Install Content Extract by Rob Shumann, before installing this plugin.
The plugin is simple to install:

1. Download the zip file, from wordpress plugin directory
2. Unpack the zip.
3. Extract zip file and upload directory present in zip file to the `wp-content/plugins` directory on your WordPress installation.
4. Activate plugin
5. Go to Settings -> Get Excerpt with Thumbnail page, to change configuration for the plug-in.

Configuration of Plug-in:

Goto Settings -> Get Excerpt With Thumbnail link in your wordpress admin page.
Following four elements need to be configured.
1) Thumbnail CSS Class -> this is .css class name to be used by this plug-in. By default, CSS class name is displayed as ‘imgstyle’, change this to your desired class name and make sure it is defined in .css file of your wordpress theme.
2) More Text -> link that appears next to excerpt to read full post.
3) Post Length -> Inspite of reading entire post to retrieve excerpt, plugin just reads number of characters entered by you in this field.
Note: Once an excerpt is generated by this plugin, it will be stored in excerpt field of your wordpress post.
4) Excerpt Length -> Length of excerpt to be displayed.
Note: Always make suer Post Length is greater than or equal to Excerpt Length.

Sample usage of this plugin:

while (have_posts()) {
$data = getExcerptsWithThumbnail();
echo $data[‘post_thumbnail’] . ‘<h5>’ . $data[‘post_title’] . ‘</h5>’ . $data[‘post_excerpt’] ;

In above code snippet,
you can see getExcerptsWithThumbnail() function returns an array.
code snippet uses <h5> tag to display title of the post, you can use any of the style you want, for the presentation of thumbnail image along with excerpt.

Screen shot of the plugin, when Thumbnail Image position is used as ‘float:left’


Screen shot of plugin, when Thumbnail Image position is used as ‘float:right’


Get Excerpt with Thumbnail plugin just gives data, presentation of this data on theme pages is left to theme developer.

Reference: see category or tag pages on to check how this plugin is used.

Please place your queries as comments to this post, so that i can reply to you.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>