67 thoughts on “Recent Posts with Excerpts

  1. ElShaddai Edwards

    Just wanted to say “thanks” for this widget! It works beautifully in conjunction with “Thumbnail for Excerpts” (though I’d love to see thumbnail support here too).

    One issue: for whatever reason, changes to the “more…” link text are not taking. They’re saving in the widget interface, but not displayed on screen.

    • Wow, thanks for reporting that — really stupid error on my part. Fixed! Version 1.11 should show up in WordPress Extend in the next half hour or so.

  2. xinfo


    it’s me from wp forum

    have you notice my following reply

    or if you want me to post it here let me know

  3. Sevim

    Thanks for the plugin! Changes to the more link does not work though. You said you fixed and uploaded it, however the new version is not there yet… Can you share the fix here? Thanks!

  4. Sorry about that! It’s there under “Other Versions” — 1.11 is the one you want. It’ll be the current one sometime in the next fifteen minutes.

  5. Nice work – best I’ve come across so far with simplicity. I am using the recent posts as a way to show upcoming events. I’d love the events to appear by descending date rather than the as written ascending order. Any easy way I can hard code the change?

  6. ElShaddai Edwards

    @ztruk: Not to take away from this plugin, but have you looked at the “Event Calendar” plugin? It adds event date/time custom fields to your posts and includes a widget for displaying those in “event order” rather than published date.

    • I should mention that I’ve just updated the widget to 2.0. It’s not that much of a feature upgrade, but apparently I was doing the version numbering wrong, so I’m just jumping way ahead to get around the problem. ztruk, your change occurs in the same place in the new version.

      The Event Calendar plugin hasn’t been updated to work with 2.8 yet. It also inserts its content via Javascript, which I find annoying and pointless. Sadly, I don’t know of a better alternative, although I’ve tried half a dozen event plugins in the last month or so.

  7. Actually, I looked into Events Calendar a few weeks back, but I wanted something that would display the event rather have to look for it. Don’t get me wrong, it has its good uses that I will probably take advantage of when they update its compatibility with 2.8.

    Stephanie, I’ll give your code a try and let you know how it goes. Thanks for the quick reply!

  8. A request to consider: can we get CSS classes on each different section of the excerpt? E.g., I want to style the post title, but it’s a generic ‘a’ before the blockquote. But applying CSS to the title ‘a’ also effects the ‘more’ text, which I don’t want.

  9. Thanks so much for adding the category selector – that’s very helpful. I’m wondering if you could also think about adding the ability to exclude a specific category? For example, I’m using a category to designate some posts as “events” — it would be nice to not show those in my recent posts/excerpts area of the home page.

    P.S. back on the events topic, I’ve found a plugin called “Events” by Arnan de Gans that works very well for simple event integration with a blogsite. And no Javascript as far as I can tell.

  10. ElShaddai Edwards

    Is there a shortcode for this plugin? I was checking out some of the other plugins in the competition and am hoping that I could use this one via shortcode in the Section Widget plugin.

  11. Stephan

    Hi Stephanie,

    It certainly would if it had the ability to pull a random number of page excerpts that were limited to only sub pages of a page. Or instead had the ability to exclude pages.

    There does not seem to be a whole lot of page related plugins for wordpress which is certainly understandable since it’s all focused around posts to begin with.

  12. Eric


    Is it possible to do this very thing in a static page instead of a widget? I’ve seen a ton of people looking for this option, but nothing is out there that I have found.

    I’ve found plugins that show a list of recent post links, but nothing that shows x number of excerpts like your widget plugin.

    Any consideration of this would be mucho appreciated!


  13. LOVE your plugin. Am wondering how to shorten the excerpts though. Changed the default word count line in the PHP from 55 to 20 but it doesn’t show through. There is no option to change in the interface that I can see.

  14. This is almost exactly what I was looking for. All I needed to add was an option to display the dates of the recent posts listed and it was perfect. Maybe something to add in to future versions?

    All-in-all though, brilliant. Thank you so much!

  15. Terri and Owen: if you have the_excerpt Reloaded installed, you’ll get an option on the widget to change the word limit. Otherwise it uses the WP default (which Owen’s link shows you how to change).

    Owen, I’ll add the dates in the next version. Thanks for the suggestion!

  16. Very nice widget!

    One request: when selecting the option to “Link widget title to blog home page”, I would like to be able to choose where it links to; if I selected the option to display certain categories, I’d like it to jump to that category page.


  17. Liam

    @ Matthew: I am looking for something along these lines as well. I would like the title to link to one specific page that is not the home page regardless the post categories. Basically just the ability to set the link destination…

    Great work, I love this widget!

  18. I realy like this plugin,
    but got kind of a question. Is it posible to reverse the post.
    On the project i am working on recently, its a website for friends of me who want to adopt a baby.
    I have 2 categories. also 2 separate widgets.
    One for blogging and one for the procedures they’ve had to take.
    And its the procedure part that has to be reversed.

    got any idea how to do this?

    thanx in advance.

  19. Thanks for a great plugin. The thing I like the most is using my own stylesheet instead of loading an extra.

    I’ve found that links in the excerpt have the quotes (“) stripped from them making the code invalid. Links still work in FF, but haven’t tested it further yet.

    Thanks again for a great plugin.

  20. Please disregard my last post.

    The culprit wasn’t this plugin, but the “Thumbnails for Excerpts” plugin.

    The quotes (“) had already been stripped before this plugin got the excerpt.


  21. This plugin is excellent! However, I have been validating my site with your widget running and you are missing </li&rt; tags for your lists. It is a simple fix but without it sites cannot validate.

  22. Wallace

    Hey, I love the plugin, its working great on the main blog page.

    I have one question, though.

    I am building a website (html and CSS, not a wordpress site), and I have a need to show off “featured posts” on the website.

    I’m not sure how to pull just the data from your widget and place it in a div on my site, and I’ve been searching, and looking through code to no avail.

    Do you know of any simple ways of doing this? My PHP isn’t very good, and I’m in a bind to get this working as soon as possible.

  23. Catching up on replies in reverse:

    Wallace, there’s no good way to use a widget without the rest of the WP structure in place. I think you’d be better off looking for an RSS parser — SimplePie, if you want PHP, or you could find a javascript-based one — and using the site’s feed instead of the widget.

    Ben, thanks for catching that. I’ll fix it in the next version.

    DM, there is no fast and easy way to do that. I’ll play around with it and see if I can work it into a future release.

    Theodore, no, not right now.

  24. I entered. “Recent_with_excerpt them blockquote” in my CCS with some properties. Unfortunately I do not get any change. You have any suggestions?

  25. Miles

    Is there a way to limit the amount of words? Love a bit of help here

    Currently it is sticking at 55, want to bring it down to about 15

    Thanks dudes

  26. On the question Posted by Matthew on September 14th, 2009 at 1:59 pm:
    I wrote a workaround to insert a link to the category within the title of the widget, awaiting a new version of the widget

    I wrote it in a few minutes then I recommend making a backup of the page before editing.

    Search text:
    echo $before_widget;

    and just below write:
    if ($instance ['cat']> 0)
    $category_link .= get_category_link ($instance ['cat']);
    else $category_link = get_permalink (get_option (‘home’));

    Search text
    else $link = get_permalink (get_option (‘home’));

    and replace it with
    else $link =”.category_link;

  27. Hey Stephan,

    Thanks for the excellent plugin. While validating the HTML on my site, I noticed that the plug-in was giving rise to two valdiating issues. I managed to correct them but I thought that you might like to know so you could possibly correct this in the next version of the plugin.

    The first issue relates to the incorrect closing of some tags outside the IF statement checking if “more_text” is empty. The original code is:

    if (!empty($instance['more_text'])) { ?><p class="alignright"><small><a href="<?php the_permalink(); ?>"><?php echo $instance['more_text']; } ?></a></small></p>

    I replaced it with the following code:

    if (!empty($instance['more_text'])) { ?><p class="alignright"><small><a href="<?php the_permalink(); ?>"><?php echo $instance['more_text']; ?></a></small></p> <?php } ?>

    Also, you have forgotten to close the tag at the end of the post loop for the widget. I rectified this by closing the tag right before the endwhile statement:

    } ?>
    </li> <?php

    I hope this helps. It doesn’t actually break the plugin, but it might bring up some quirks on older browsers. Thanks for the plugin!


  28. Bene

    hello stephanie,

    very useful plug-in, thanks for that!

    i just would like to know how to change the “more…” below the excerpt directly in the PHP.
    because in my case i need to place something like [lang_en]more englisch[/lang_en][lang_de]more deutsch[/lang_de] in the code to get it working for both languages! any idea? when i tried to type in anything else instead of i get a syntax error. i am not a PHP-professional, so i dont know what to do…


  29. Aloha!

    I just discovered a nesting error on Line 84:
    if (!empty($instance['more_text'])) { ?><a href="”>

    The “if” ending brace should occur after the

    Also, after line 87, the ==== from line 76 should be closed.

  30. Aloha!

    I just discovered a nesting error on Line 84:
    if (!empty($instance['more_text'])) { ?><a href="”>

    The “if” ending brace should occur after the

    Also, after line 87, the ==== from line 76 should be closed.

  31. Gavin

    Nice work! I was wondering how I would go about broadening the query to return not only posts, but also a couple custom post types I have created. I’ve never seen a query in the same format as it is in your code.

    Thank you!

  32. Thanks for the great plug-in.

    You are missing the closing LI tag before the end of your while loop. It causes validation to fail and potentially javascript as well.

  33. just like the world says, the plugin is amazing.

    there is a but. the plugin can’t show the recent post in the sub category, it will goes to parent category.

    i hope you can tell me how to fix it.

  34. lala

    is it possible to translate “more…” link using WPML? i cannot find it in string translation, thank you! …still very nice plugin!

  35. yoko

    Hi, thanks for the great plugin!

    When I insert the caption to the image in the post, actually the image caption shows up in the widget before the post. Is there any way not to show the caption in the widget?

  36. Christopher

    Hi is it possible to style the name of the featured post? Currently it shows up the same size as the main post header in the centre column.
    Any help would be great. Nice plug-in.

  37. Ooops, that code was munched up by some filter. Anyway, line 90 of recent-with-excerpts-widgets.php leaves three stray closing elements (a, small and p) if more_text is empty.

  38. Eileen Callahan

    Love your plugin for post excerpts, but I’m finding that the “…more” link is too far below the text of the excerpt to work with my theme.

    What would I change to move it up closer (like on the next line below the excerpt, instead of 2 or 3 lines below, as it is now)?

    Thanks so much!

  39. Love the plugin but when you click the post to read more and it goes to the blog the whole exerpt is included. So it’s repeating itself.

    Here is what happens – so the link was clicked and now you are reading the post page with the full post. Note the first 7 sentences are repeated so the exerpt is getting tagged on to the beginning of post making it quite redundant. How do I fix this?? (See example below)

    One of the things I love about the Energy Balls is how flexible they are. While we recommend starting your day by taking 3-4, it is perfectly acceptable, and we encourage, you to play with your protocol.

    Recently I began having 5 in the morning first thing when I wake up. I have noticed [...]

    One of the things I love about the Energy Balls is how flexible they are. While we recommend starting your day by taking 3-4, it is perfectly acceptable, and we encourage, you to play with your protocol.

    Thank you for your help and for the plugin.

    • Stephanie

      Hi, Sadee. Normally, you would want the excerpt to be repeated, because people might reach that article in other ways (searching, linking from another post, etc.). If you really do want to omit it, though, you could replace the_content() in your theme file with get_extended(). The Codex info is a little sparse, but Monday By Noon has a good explanation.

Comments are closed.