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()) {
the_post();
$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 SearchAndhra.com to check how this plugin is used.
Please place your queries as comments to this post, so that i can reply to you.
28 Responses to “Get Excerpt with Thumbnail Image – WordPress Plug-in”
July 18th, 2009 saat: 9:50 pm
It is not working with Content Extract. Can we use any other excerpt plugin.
July 18th, 2009 saat: 10:55 pm
Works great, thank you
July 20th, 2009 saat: 8:02 pm
i tried only with Content Extract. Content Extract is working fine here. Please download from mentioned link in the post.
July 28th, 2009 saat: 11:46 pm
hi,
i seem to have a hard time following this instruction – 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.
can you please expound or simplify this step if you don’t mind.
ty!
July 29th, 2009 saat: 12:28 pm
hi
by default this plugin uses, thumbnail css class as ‘imgstyle’, you can define a style with this name in your .css file.
Or else if you want to put some other css class name, put that class name in configuration settings of this plugin.
Basically thumbnail css class style will be used to align your thumbnail image to left or right.
You can just use sample css settings given in configuration settings, to test and then define your own css settings.
Thanks
chetanz
July 29th, 2009 saat: 1:36 pm
hi,
I’m sorry if I sound too dumb but I’m just a new blogger.
you can define a style with this name in your .css file. (what css file are you referring to?)
do i need to alter, edit, or type a certain code in a php or css file in my website’s public html folders?
your response is greatly appreciated.
ty
July 29th, 2009 saat: 2:29 pm
hi
you need edit .css file of your theme in wordpress wp-content/ directory.
July 29th, 2009 saat: 2:50 pm
thanks,
in what specific line will i place the code?
July 29th, 2009 saat: 6:03 pm
Hi
add this line at any location in your wordpress theme .css file.
imgstyle{margin: 5px; float: left;}
Thanks
Chetanz
July 29th, 2009 saat: 11:02 pm
hi,
what css file are you referring to? I tried adding the said line in the style.css but to no avail.
i tried placing it at the beggining, end, center but still it didn’t work. is it some kind of wrong code placement or did i edit the wrong css file in my wp-content/themes directory?
August 6th, 2009 saat: 10:21 am
[...] Get Excerpts with Thumbnail Images [...]
August 7th, 2009 saat: 12:56 am
Hi I have installed everything and what code and where do i place it for it to appear on my homepage
August 8th, 2009 saat: 9:36 pm
Hi
Could you help , what code do i put in the theme file , pls help , for where i want it displayed
August 10th, 2009 saat: 11:14 pm
Hi
Admin , Could you please help , I need to know what im doing wrong , cannot get this to work.
PLEASE HELP……
August 11th, 2009 saat: 9:15 am
Hi
put following code in your index or home page or whatever page you want.
while (have_posts()) {
the_post();
$data = getExcerptsWithThumbnail();
echo $data['post_thumbnail'] . ‘’ . $data['post_title'] . ‘’ . $data['post_excerpt'] ;
}
In addition, define a css style in your theme .css file as below
imgstyle{margin: 5px; float: left;}
you can change style name from imgstyle to any other name, in configuration settings of this plugin.
Thanks
Chetanz
August 12th, 2009 saat: 8:13 am
ok i did everything , not working , Could i email you the whole page of code and u could see whats wrong PLEASE………………
August 12th, 2009 saat: 11:37 am
JS – Goto your exact theme folder which your using, and findout style.css file or else go to header.php file and search for .css file there you can find name of the .css file, and the .css code anywhere in that file…
August 12th, 2009 saat: 5:26 pm
Ok Jeezy
send me your page to me at chetan.g@gmail.com
Thanks
chetanz
August 14th, 2009 saat: 2:57 pm
I want to use this plugin but it doesnot work because I am doing the wrong edits. Many people have no knowledge what code to edit.
Please give a tutorial of the default wordpress theme explaining what code to edit and replace in the index file.
Please note many site owners have no knowledge of php.
September 13th, 2009 saat: 5:36 pm
I have to use a code to get only the posts of a certain category?
September 18th, 2009 saat: 10:36 pm
Hi ! Great plugin, but it displays every excerpts. What should I do if I’d like it to display, say, only posts #1 & #15 ?
Thanks in advance for your kind answers
October 9th, 2009 saat: 10:57 am
Put an if condition checking id of post over plugin function call.
January 20th, 2010 saat: 6:27 am
I use align left in the Thumbs Excerpts options page, but on my homepage, the thumbnail is located under the Post Title next to the excerpt. I would like to get the thumbnail aligned left of BOTH the post title and excerpt, just like you show in the sample pictures above. Thank you for your time with this concern.
April 1st, 2010 saat: 1:52 am
In your explain,how can paste the code in home or index.php??
Such code type is found in function.php but <?php or <div are found in index. So,#14 jeezy also asked.
Could you give more comment?
———–
while (have_posts()) {
the_post();
$data = getExcerptsWithThumbnail();
echo $data['post_thumbnail'] . ‘’ . $data['post_title'] . ‘’ . $data['post_excerpt'] ;
}
———–
April 1st, 2010 saat: 2:15 am
also, the plugin can operate in wordpress Page, not category?
That is, display in parent Page from image, excerpt in child(sub)Page?
If do so, how can arrange the code?
Thanks in advance
April 2nd, 2010 saat: 12:08 pm
yesterday I asked you two,incert code to index & applicable or not in WP Page as 2 msg as #24, #25.
Is there any problem? The two asking seems like a spam?
How can I figure this situation…
April 17th, 2010 saat: 10:53 am
Hi,
Is it possible to extract the thumbnail and permalink of a page?
Thanks
July 21st, 2010 saat: 4:05 am
Hello,
I installed both the content extract and your Get Excerpt with Thumbnail image plugins onto the website I am working on and it does not seem to work. I followed all the intructions yet the front page is still displaying the entire text of the posts and not excerpts. Can you tell me what I am doing wrong? the site is geraldhurricaneharris.com/blog
Thanks!
Leave a Reply