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’

scree1

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

scree2

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”

  • 1 beauty blog Says:

    It is not working with Content Extract. Can we use any other excerpt plugin.

  • 2 baron Says:

    Works great, thank you

  • 3 admin Says:

    i tried only with Content Extract. Content Extract is working fine here. Please download from mentioned link in the post.

  • 4 JS Says:

    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!

  • 5 admin Says:

    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

  • 6 js Says:

    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

  • 7 admin Says:

    hi

    you need edit .css file of your theme in wordpress wp-content/ directory.

  • 8 js Says:

    thanks,

    in what specific line will i place the code?

  • 9 admin Says:

    Hi

    add this line at any location in your wordpress theme .css file.

    imgstyle{margin: 5px; float: left;}

    Thanks
    Chetanz

  • 10 JS Says:

    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?

  • 11 Use Excerpt with Thumbnails in wordpress themes « Hema Sunder Says:

    [...] Get Excerpts with Thumbnail Images [...]

  • 12 EZ Says:

    Hi I have installed everything and what code and where do i place it for it to appear on my homepage

  • 13 Jeezy Says:

    Hi

    Could you help , what code do i put in the theme file , pls help , for where i want it displayed

  • 14 Jeezy Says:

    Hi

    Admin , Could you please help , I need to know what im doing wrong , cannot get this to work.

    PLEASE HELP……

  • 15 admin Says:

    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

  • 16 Jeezy Says:

    ok i did everything , not working , Could i email you the whole page of code and u could see whats wrong PLEASE………………

  • 17 telugu movie Says:

    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…

  • 18 admin Says:

    Ok Jeezy

    send me your page to me at chetan.g@gmail.com

    Thanks
    chetanz

  • 19 beauty blog Says:

    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.

  • 20 r4ibOm Says:

    I have to use a code to get only the posts of a certain category?

  • 21 Pat Says:

    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 :)

  • 22 admin Says:

    Put an if condition checking id of post over plugin function call.

  • 23 Todd Says:

    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.

  • 24 tango Says:

    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'] ;
    }
    ———–

  • 25 tango Says:

    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

  • 26 yesterday Says:

    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…

  • 27 Roy Says:

    Hi,

    Is it possible to extract the thumbnail and permalink of a page?

    Thanks

  • 28 Danielle Says:

    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