Recent Posts

Purpose

This plugin displays a list of the most recent posts to your blog in a highly customisable way.

This is version 2.6.2.0 download latest version. It is compatible with WordPress 1.5–2.6.2.

The plugin has an options page which lets you change how the output is generated and displayed.

Installation Instructions

  1. If upgrading from a previous version, first deactivate the plugin via the Plugins page and delete the plugin folder from your server.
  2. Upload the plugin folder to your /wp-content/plugins/ directory. You will also need to install the Post-Plugin Library.
  3. Go to your admin Plugins page and activate Recent Posts.
  4. Put <?php recent_posts(); ?> at the place in your theme files where you want the list of similar posts to appear. Lorelle on WordPress has a good guide to modifying themes for plugins. If you are using a widget-ready theme the plugin can be placed from the widget admin page.
  5. Use the admin Settings|Recent Posts page to set all the available options. Alternatively, the options can be overridden by passing a parameter to the recent_posts template tag.

Usage and Options

The configuration page will help you to set up the plugin to your satisfaction.

If you also install the latest version of Plugin Output Cache the output of this plugin will be automatically cached for efficiency.

Note: If you find that your list of recent posts comes out backwards it is probably because you have MySQL version 4.1.21. That version of MySQL has a bug when a SELECT statement has both DISTINCT and ORDER BY clauses. The latest versions of the plugin (2.5+) avoid this MySQL bug.

Finally…

I look forward to your help in ironing out any issues and implementing any good ideas. The plugin settings page has an option to submit bug reports but general comments can be left below.

Frequently Asked Questions

[faq list Recent Posts]
[faq list General Post Plugins]

206 Comments Add your own

  • 1. Rob  |  March 17th, 2008 at 6:20 pm

    Version 2.5 b3 posted

  • 2. Sue  |  March 25th, 2008 at 2:12 am

    Hi Rob,
    I got this running right away, and would like to do just one thing, and that is indent the date by 2 spaces or align it with the link. How do I do that?
    Thanks!
    Sue

  • 3. Rob  |  March 25th, 2008 at 8:12 am

    Sue: I’m not clear what you mean. Which date? Which link? Could you show me what your output template is?

  • 4. Sue  |  March 26th, 2008 at 4:48 am

    Hi Rob,
    I am using this in my right sidebar in the area near the top entitled “Featured”. I have jury-rigged the date by using   to push it to the right 2 spaces but would like to affect that indentation using proper code with your plugin. Would I use a div code for that? I am using your date code in the plug in config with the post link.
    many thanks,
    Sue

  • 5. Rob  |  March 26th, 2008 at 7:51 am

    Sue: Looking at the source code on your page I notice an extra <ul> in the Featured section. You are probably placing one before the plugin call AND asking for one in the plugin output (the prefix setting). Get rid of one or the other and the output should behave like your other lists… if that is what you want!

  • 6. thomas  |  April 3rd, 2008 at 8:05 pm

    Updated my blog to WP 2.5 and after updating the Recent Posts plugin it only shows the message “Post-Plugin Library missing”.

    How can I fix this?

  • 7. thomas  |  April 3rd, 2008 at 8:06 pm

    Ah, sorry. Found out I have to install the post-plugin library plugin. I am really sorry.

  • 8. printer  |  April 4th, 2008 at 5:08 pm

    Thanks for this great plugin. Its pefect for the site I am building.
    I have a question though, I have this other plugin called “Post Thumb Revisited”. i want to put the thumbnails generated by this plugin to show up before my recent-posts titles in the sidebarwidget. I’m not sure what it is that I should put in the ‘ custum field’ .. i think it should be something like this: <li>{link}<img src="{custom:function get_thumb}"</li> but what can be the so called ‘custom field’? ‘function get_thumb’ does not work. an url to the folder does not work either. Any hints on this? Thanks!

  • 9. Rob  |  April 4th, 2008 at 6:02 pm

    printer: You have two options I think. One is to try out the {image} tag which might do what you want; the other is to use not {custom} — which only works if the other plugin stores things in custom fields — but {php} which will let you call the get_thumb function.

  • 10. online business blogger  |  April 5th, 2008 at 2:23 am

    Rob

    can this plugin RecentPost work with wordpress static pages? I have it working with posts but, of course, pages don’t have categories.
    forgive me for taking up your time with silly questions, guess I should RTFM

  • 11. Rob  |  April 5th, 2008 at 3:24 pm

    online business blogger: You can choose to have pages included or not.

  • 12. printer  |  April 7th, 2008 at 9:10 pm

    Thanks Rob, i tried what you said.. Both ways worked indeed. I like the php field option. to bad i can not get it to display the thumbnail fot the correct post.. only the first one. i will try some more.. thanks for the hint.

  • 13. Rob  |  April 7th, 2008 at 9:17 pm

    printer: You can imagine that the {php} tag has passed to it the $result variable — an object corresponding to each post with values named after the columns of $wpdb->posts. For example, $result->ID.

  • 14. printer  |  April 8th, 2008 at 12:11 am

    Rob, I understand what you mean. I think.. The get_thumb() tag needs a reference to the post. What I now have is {link} {php:get_thumb()} in my field input. It has to be somthing like {php:$wpdb->posts->$result->get_thumb()} then? I will try some tommorow. thanks

  • 15. Rob  |  April 8th, 2008 at 12:36 am

    printer: I’ve just been looking at how Post Thumb Revisited works. Unfortunately, it is set up to give a thumbnail from the current post which is why you have been getting the effect you have. It seems to me that you could use the {image} tag to do the same job. get_thumb() finds the first image in a post and returns a thumbnail of it; {image:0} does the same. You can also specify the size of the thumbnail by adding extra parameters, e.g., {image:0:96) for 96px square thumbs, or in general {image:0:width:height}.

  • 16. adspedia  |  April 8th, 2008 at 9:39 am

    Is it possible to show a area of recent blog posts to my website, thus outside the WP CMS?

  • 17. Rob  |  April 8th, 2008 at 9:49 am

    adspedia: To be honest I have never tried. I notice you visited from a forum page proposing an answer to that question. Have you tried it?

  • 18. Printer  |  April 8th, 2008 at 12:16 pm

    Rob, I understand. I tried it with the {image} tag. Unfortunately it looks like the image get scaled (when I set the settings to display the image smaller). And therefore it looks a little “pixelated” or whatever, instead of creating a real thumbnail of course. But I think I will leave it without an image-thumb in the recent-posts then. I found the ‘Post Thumb Revisited’ plugin a little hard to tweak and manage to my liking. So I will stay with the recent-posts plugin for now. Thanks.

  • 19. Rob  |  April 8th, 2008 at 12:39 pm

    Printer: I think my own plugin should also make real thumbnails instead of just setting the display size — the current situation is a stopgap. So sometime soon real thumbnails may appear.

  • 20. Printer  |  April 8th, 2008 at 6:58 pm

    That would be great Rob. I’m building an illustration blog where different authers will publish there work. A thumbnail would be a nice little extra within the recentposts list. I’m realy looking foreword to it.Thanks very mutch for all the help so far! Ill stay tuned.

  • 21. Rene  |  April 8th, 2008 at 10:27 pm

    Hi Rob,

    first of all: I like you’re plugin very much! And your ‘how to’ is very clear.

    One question: I’m using the {image} tag in the recent comments. The images show up indeed, but I want some extra space between the image and the text. Is that possible? And, if yes, how? Thanks for your attention in advance.

  • 22. Rene  |  April 8th, 2008 at 10:39 pm

    Oh… I’m sorry. I found the solution right after I posted my question. Quite simple after all. I just added

    #recent-posts img {
    margin: 0 5px 0 0;
    }

    to my stylesheet.

  • 23. Rob  |  April 8th, 2008 at 10:43 pm

    Rene: Great! CSS and the output templates make a very powerful and flexible combination.

  • 24. Kuri  |  April 10th, 2008 at 10:21 am

    Thanks for this plugin. However, upon installation, it seems the plugin isn’t picking up on the CSS for links styling? Any advice on what I should do here?

  • 25. Rob  |  April 10th, 2008 at 2:02 pm

    Kuri: I’ve just looked at the source of your page and I wonder what you are using for the output template? Maybe you could send me a bug report from the plugin’s setting/options page and it will tell me the details.

  • 26. Diwaker  |  April 10th, 2008 at 6:26 pm

    I recently upgraded the plugins (using the WordPress auto upgrade mechanism). Everytime I upgrade your plugins (shared library, similar/recent posts, recent comments etc), I lose the corresponding widgets from my theme and I have to go back and re-enable them. Is this a known issue? Thanks for the great work!

  • 27. Rob  |  April 10th, 2008 at 9:22 pm

    Diwaker: I haven’t had reports of this before… It’s possibly because I tried a change in the registration of the widgets and then switched back. But it could be a real bug … I’ll keep my ears open.

  • 28. Jens  |  April 13th, 2008 at 11:19 am

    Hey!

    I have used your recent posts plugin for a while now and it has been working great! Today I used the wordpress upgrade plugin automatically-function to get the latest version, after this it also said i needed the post-plugin library, which i didn’t have before, and i installed it. The problem is, now it doesn work anymore, and i had to remove it from my first page where i used to have my recent posts listed.

    The problem was that when it came to fetch the posts, it just stopped and nothing showed, and also the loading of the rest of the page stopped. Do you know what the problem might be? Thanks! // Jens.

  • 29. Rob  |  April 13th, 2008 at 11:27 am

    Jens: First, just check that the old plugin folder has been removed and the new one is in place (with its name-change to ‘recent-posts-plugin’). Then try deactivating the recent posts plugin and reactivating it. That usually does the trick. If not get back to me.

  • 30. Jens  |  April 13th, 2008 at 11:44 am

    Hey, thanks for the quick reply! Unfortunately it doesn’t seem to work. It is in place, I tried to deactivate and activate again, but as you see on my first page, http://www.jensfilipsson.com, it doesn’t load up correctly. If you check http://www.jensfilipsson.com/blogg, i also have a footer that doesn’t load up on the first page. And of course, no recent posts there either.

  • 31. Rob  |  April 13th, 2008 at 12:24 pm

    Jens: Can you leave a bug report from the Recent Posts settings page? It will give me some more information to help debugging.

  • 32. Jens  |  April 13th, 2008 at 12:27 pm

    Done!

  • 33. Jens  |  April 13th, 2008 at 1:03 pm

    Hey, I just went to look at my widgets page, and instead of displaying the list of availible widgets and sidebars, it stops loading at the recent posts widgets, which looks like thiis:

    %BEG_OF_TITLE%Recent Posts%END_OF_TITLE%

    so I guess there’s something wrong with the code or something somewhere?

  • 34. Rob  |  April 13th, 2008 at 2:22 pm

    Jens: Looking at the bug report you just sent … I’m not seeing any options set. Either there’s something wrong with the bug report (possible) or you need to go to go to the settings page and set up some option values.

    Meanwhile I’ll look again at the Recent Posts code.

  • 35. Jens  |  April 13th, 2008 at 2:37 pm

    Hey!
    Unfortunately I have options set, they are the same as before I upgraded. And, the problem with the widget not loading correctly I would say suggests that something is wrong.

    I’m removing it from my front page now, so that the page can load normally, but I hope to be able to put it back soon, it’s a great plugin! :)

  • 36. Rob  |  April 13th, 2008 at 5:21 pm

    Jens: The problem was traced to the code that strips pseudo-tags from snippets. It is fixed in Post-Plugins Library 2.5b21.

  • 37. Ghost  |  April 16th, 2008 at 12:56 pm

    Hi there Rob,
    I don’t know how to use this plugin exactly. I’ve installed everything necesary and i’ve installed the Recent_posts plugin but i dont know how tu put it on the first page . I want to use this plugin to show the latest posts in one single post . For example , let’s say i’ve posted 5 posts recently . I want to show a list with the latest posts in one single post on the front page of my website I hope you understand what I want .

  • 38. Rob  |  April 16th, 2008 at 3:14 pm

    Ghost: I’m not exactly sure what you mean. Is your first page supposed to be blog-like or is it a static page? I mean is it what WordPress calls a page or a post?

    You have to insert a call to recent_posts() somewhere in your one of themes’ php files. But where depends on the answer to the questions I asked?

    Give me a clue and I’ll be glad to help.

  • 39. Ghost  |  April 16th, 2008 at 6:43 pm

    I think it’s more a static page . I want to have a list of the lastest 30 posts for example on the main page , in the center , like a post . I don’t want the Latest_posts plugin on the right or left , just in the center of my main page .

  • 40. Rob  |  April 17th, 2008 at 4:55 pm

    Ghost: You will need to create a page template to do this. It’s not hard to do but may be unfamiliar. When you create a static page in WordPress it is based on a template. The template contains code and defines where in the page the stuff you enter in the write screen goes. To include recent_posts() in a front page you need to make a copy of the page.php template file, edit it suitably, and then create a page based on it that will be your first page.

    For more information visit the codex: here, here, or here

    Good luck!

  • 41. Martin  |  April 18th, 2008 at 12:58 am

    Hi
    Fantastic plugin, lots of features. Well done !

    Quick question , I want to put the {categorylinks} at thetop of the links but it keeps repeating the {categorylinks} for each post link…. how can I get around this ?

    {categorylinks}
    {date: F j} | {link}

    This keeps repeating the category link above each category post. I just want one instance of the category link at the top.

    thanks
    Martin

  • 42. Rob  |  April 18th, 2008 at 9:35 am

    Martin: I’m sorry but you can’t do that within Recent Posts right now, though I’m considering adding the feature. You can, of course, put the category links before the call to recent_posts() in your theme file.

  • 43. Martin  |  April 18th, 2008 at 9:56 am

    Hi Rob

    Thanks for that. Ok , so what is the code syntax to put the category link before the call to recent_posts(). I had a look on the site here but coudnt find any examples.

    Thanks
    Martin

  • 44. Rob  |  April 18th, 2008 at 10:00 am

    Martin: Just an ordinary WordPress template tag. Probably
    <?php the_category(','); ?>.

  • 45. Martin  |  April 18th, 2008 at 10:47 am

    OK thanks Rob. That *worked* but I am using two instances of the recent posts on the same page and because its showing posts from two seperate categories, then it will only show the first category title on that page ….. unless I am missing something .

    thanks again
    Martin

  • 46. Rob  |  April 19th, 2008 at 10:08 am

    Martin: I’m not sure exactly what you are trying to do (sorry). The {categorylinks} tag ‘knows’ which links to show because it can look at the post it is currently displaying. You will need to duplicate that manually. If you know which category id you want to display you can use get_category_link() to get the category url which you would have to wrap in a hyperlink.

    If you look at the ‘otf_categorylinks’ function in ‘/post-plugin-lubrary/output_tags.php’ it will give you the idea.

  • 47. Arwen  |  April 19th, 2008 at 2:28 pm

    Hi Rob. Firstly I want to let you know that I really love your plug-in. I have a simple question, and the answer is probably right in front of my face, but I can’t for the life of me figure it out.

    I am building a theme for my site that uses the Recent Posts plugin to show a list of “updates” posts on my sidebar. All of these one-sentence posts will go in the “update” category in my WP. Now I’ve easily and quickly configured your plug-in so that it only shows the posts from the “update” category, but now how do I exclude those very same posts from my WP main page?

    Essentially, I don’t want them showing up as normal posts on my blog, I want them showing up on the “updates” section of the sidebar. I’m halfway there, I just need to figure out how to exclude them from showing up on the front of my blog when I post a new one.

    For example:

    The “snippets” on http://www.guitarangel.net

    or

    The “asides” on http://www.jemjabella.co.uk

  • 48. Rob  |  April 19th, 2008 at 4:06 pm

    Arwen: Your question then is really how do you exclude a category from the list of posts on your front page…

    Here are a couple of resources that should help. These, from the Codex and Perishable Press, seems right on the mark. The other, from the Codex, is more general.

    I hope these help!

  • 49. Arwen  |  April 19th, 2008 at 4:37 pm

    Thank you very much!

  • 50. Arwen  |  April 19th, 2008 at 4:48 pm

    Thanks… although they don’t really help with the new version of wordpress. They make references to category ID numbers, which I can’t find in the new wordpress admin panel.

  • 51. Rob  |  April 19th, 2008 at 5:24 pm

    Arwen: You might well find that the category slug works instead, though I am not sure. However, it is easy enough to find the category ID. Go to the Manage | Categories screen and hover over the name of the category you are interested in and the browser status bar should show it. If you have the status bar disabled click on the link and look in the address bar of the page you arrive at.

    Good Luck!

  • 52. Arwen  |  April 19th, 2008 at 5:25 pm

    Nevermind, I was able to figure it out. Thank you for the help!

  • 53. Blog Bloke  |  April 25th, 2008 at 8:33 am

    When I try to deactivate the plugin it blows apart my template right after section that I used your plugin. Any suggestions?

    …BB

  • 54. Lucas  |  May 13th, 2008 at 11:11 am

    I think its a great plugin, too bad it doesn’t have a feature to hide it from the frontpage, so its only visible when a single article is viewed! I do like the option that you can skip a number of posts!

  • 55. Lucas  |  May 13th, 2008 at 11:13 am

    Sorry, I found it!! Great plugin!

  • 56. Lucas  |  May 13th, 2008 at 11:52 am

    I would like to show Recent Posts on pages and single posts.

    So I use the option, is_single() on the widget page where it says ‘show only if page’. Now the recent articles are not showed on pages.

    In the General Settings page there is an options ‘Show static pages?’. Setting this to ‘Both pages and posts?’ also shows pages on the recent posts list. And shoulds it only on single posts!

    In the widget page (‘show only if page’.) I changed is_single() to is_single(),is_page() and is_single(),is_page(pagename) and to is_single();is_page() with a dot/comma. But the recent posts list is showed on the pages like this.

    How can this be done?

    Great help!

  • 57. Lucas  |  May 13th, 2008 at 11:54 am

    In the widget page (’show only if page’.) I changed is_single() to is_single(),is_page() and is_single(),is_page(pagename) and to is_single();is_page() with a dot/comma. But the recent posts list is NOT showed on pages like this.

    How can this be done?

  • 58. Rob  |  May 13th, 2008 at 2:28 pm

    Lucas: You are heading in the right direction. The condition in the widget settings has to be a valid PHP expression so it should be something like:

    is_single() || is_page()

    i.e., show if a single ‘page’ OR (‘||’) a page ‘page’.

  • 59. Lucas  |  May 13th, 2008 at 11:26 pm

    Thanks, you are my person of the day!

  • 60. Venus  |  May 18th, 2008 at 12:33 am

    Hi, I love this script but how do I remove the micro time? I try editing the common_functions.php and recent-posts.php but that would just give me a bug. I know I’m doing something wrong. I try to take out:

    function ppl_microtime() {
    list($usec, $sec) = explode(” “, microtime());
    return ((float)$usec + (float)$sec);
    }

    and

    $result = poc_cache_fetch($cache_key);
    if ($result !== true) return $result . sprintf(““, 1000 * (ppl_microtime() – $start_time));

    function check_post_plugin_library($msg) {
    $exists = function_exists(‘ppl_microtime’);
    if (!$exists) echo $msg;
    return $exists;

    I know it doesn’t really do anything to the page layout but I’m just trying to use less process on the server as possible. Thanks

  • 61. Rob  |  May 18th, 2008 at 9:03 am

    Venus: The timing load is trivial compared to the load imposed by the plugin.

  • 62. Mattias  |  May 19th, 2008 at 4:52 pm

    Just updated to 2.5.0 and my configuration broke :( I’m using recent_posts('included_cats=1');, has something been changed or why are the pages showing up as well?

    General Settings -> Show static pages? is set to “No pages, just posts”

    Using WP 2.5.1

  • 63. Rob  |  May 19th, 2008 at 5:30 pm

    Mattias: Just fixed in version 2.5.0.3 of Post-Plugin Library. I messed up the code yesterday while making everything WP MU compatible.

  • 64. Mattias  |  May 19th, 2008 at 5:42 pm

    Ah I see, shit happens :P Good work!

  • 65. Lazy  |  May 20th, 2008 at 8:44 am

    Hi,

    i`m not sure how to use {imagesrc} and {image}.. is there a page which explains these two new tags to me? ;)

    have a nice day

    Chris

  • 66. Rob  |  May 20th, 2008 at 10:17 am

    Lazy: Try this full listing of the output template tags and their usage. If you have more questions just ask.

  • 67. Karl Bedingfield  |  May 26th, 2008 at 9:53 pm

    Hi there,
    Love this plugin :)

    Is there a way for me to get the date to display 26:05:2008?

    Many thanks
    Karl

  • 68. Rob  |  May 28th, 2008 at 9:33 am

    Karl: You have to supply a date format string to the {date} tag. The details are in the PHP docs.

    You might try:

    {date:d:m:Y}

  • 69. Rob  |  June 4th, 2008 at 10:41 am

    If you had the misfortune to download version 2.5.0.7 you may run into problems when you try to update to a newer version. I managed to introduce a circular dependence between this plugin and the Post-Plugin Library which means trying to update either from the admin plugins page will cause an error. Instead you need to delete the 2.5.0.7 version from the server (Post-Plugin LIbrary too) and upload the newer one and the problem should be solved. I apologise for any worry or inconvenience.

  • 70. John  |  June 19th, 2008 at 2:57 am

    Is there a way to make it diplay ALL the posts? (no limit)?
    Great plugin otherwide, thx !

  • 71. John  |  June 19th, 2008 at 3:18 am

    nevermind, got it….line 171, THX

  • 72. Rob  |  June 19th, 2008 at 2:41 pm

    John: I’m glad you found what you wanted. I was going to suggest using a very large number!

  • 73. Karl Bedford  |  June 19th, 2008 at 10:02 pm

    Hi there,

    Love this plugin.

    I just noticed that although I set in Recent Post admin not to show current post it shows currrent post.

    Any idea what might be causing that? Could it be a plugin conflict?

    I am using current build of plugin and library.

    Thanks
    Karl

  • 74. Rob  |  June 20th, 2008 at 9:47 am

    Karl: I’m not able to duplicate that here. Could you send me a bug report from the plugin’s settings screen — it might help me notice something?

  • 75. Karl Bedford  |  June 20th, 2008 at 6:17 pm

    Hi there,

    Thanks for replying: I have found the problem – it is my coding for a feature function I am using for my front page. You can view my code here: http://paste-it.net/public/d22077d/

    Is there anything that can be changed to my code to stop the conflict?

    Thanks in advance.

    Regards
    Karl

  • 76. Rob  |  June 20th, 2008 at 9:31 pm

    Karl: You can try using wp_reset_query() to reset the original query after you have finished doing your own query. You could also try using the WP_Query class directly.

    I hope you’ll let me know what works.

  • 77. Karl Bedford  |  June 21st, 2008 at 6:13 am

    Hi Rob,

    Thank you for the post. I am not that great with PHP, in what context (where would I) would I put the reset code?

    Sorry to be a pain :)

    Thanks
    Karl

  • 78. Rob  |  June 21st, 2008 at 10:03 am

    Karl: I’d try putting it after each of the ‘endwhile’ statements:

    
    <?php endwhile; ?>
    <?php wp_reset_query(); ?>
    

    You might get away with just the one instance after the last endwhile but you’d have to experiment to see what works.

  • 79. Karl Bedford  |  June 21st, 2008 at 2:10 pm

    Hmmmmmm, still appear to be having problems. I tried the WP Query Class but it still showed the current post in the list.

    I have found out that when this block is removed the current post is hidden: http://paste-it.net/public/ocd30e5/

    I took out the timthumb.php line from this code to see if that made a difference – it did not.

    Is there anything else in tis block that may cause problems?

    Thanks for your patience.

    Karl

  • 80. Rob  |  June 22nd, 2008 at 11:37 am

    Karl: sorry to take some time replying — you got lost in spam for some reason.

    I can’t see any obvious difference between the two blocks that might matter.

    You might try this: edit the Post-Plugin Library file common_functions.php. Around line 200 you’ll find the function ppl_current_post_id. Replace it with the version below:

    
    function ppl_current_post_id() {
    	$the_ID = $GLOBALS['wp_the_query']->post->ID;
    	if ($the_ID) return $the_ID; else return $GLOBALS['wp_the_query']->posts[0]->ID;	
    }
    

    I am clutching at straws here and guessing that maybe the global isn’t setup right for some reason. This may or may not help. Let me know.

  • 81. Rool  |  June 22nd, 2008 at 7:48 pm

    Hi Rob,

    Great plugin this is but i have 2 questions.

    1. When i put in the settings by output this code: {date:Y, F} and then save it. I take a look at my website an see the same code {date:Y, F} it doesn’t show the date ?? Take a look at http://vtbl.nl and you see what i mean.

    2. I have a plugin installed who put icons by the categories. Is it available to show this icon in front of the headline? I also want the time before the headline.

    Grt Rool

  • 82. Rob  |  June 22nd, 2008 at 9:18 pm

    Rool: 1) It looks like you’ve put the date tag in the prefix codes box and not the output template. The prefix and suffix aren’t interpreted for tags (right now … I have been thinking of offering that option). I may be wrong–let me know.

    2) The other plugin can probably be included but it really depends how it works. Someone has done something similar: see this comment.

  • 83. Steve  |  June 24th, 2008 at 1:19 am

    Question.
    Can I use this plug in to display the titles of specific posts in a category?
    Right now, displaying the following in a sidebar…

    <ul id="sidebarwidgeted">
    	
    	<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>
    			
    	<h3>Special Information</h3>
    			<a href="<?php echo get_settings('home'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/graphic_admission_price.jpg" alt="Admission only $12 for the general park pass and $20 for the adventure sports pass." /></a>				
    		<li id="recent-posts">
    		<h2>Upcoming Events at Brownstone Park</h2>
    			<ul>
    <?php get_archives('postbypost', 10); ?>
    			</ul>
    		</li>
    	
    	<?php endif; ?>
    	
    	</ul>

    Instead of the 10 most recent posts, I want to display only selected posts from one category.

    These are “events”. I only want to display the events that happen in the future.

    Can I do this? Can you help?
    Thanks!

  • 84. Rob  |  June 24th, 2008 at 9:54 am

    Steve: Yes, you can choose to show just future posts from a particular category.

  • 85. Steve  |  June 24th, 2008 at 1:00 pm

    Rob,
    Thank you. I’ve been playing with it a bit and got it to display specific posts in one category.

    Is there a way to display them in a specified order? These posts are categorized as “events” and although we post them all the time, we want to be able to display the next event at the top of the list without changing the post date. Maybe use a custom field with the start and end dates for the event?

    Also, is there a way to add a second widget that calls a specific post from a different category? With that one I want to display the title and the first 115 characters of the post and the publish date. Either that or use a custom field to show “last updated” date. This would be for current conditions at a location (we would display water temp at a quarry).

    My development area is dev.brownstonepark.com

    Thank you!

  • 86. Rob  |  June 24th, 2008 at 3:03 pm

    Steve: The custom field sounds like a good idea. You’ll see that you can sort your output according to any output tag, including {custom}. It’ll be easiest if the date format you choose sorts naturally.

    It is possible to have more than one instance of recent posts on a page by passing a parameter string. You can’t, however, do that with the plugin as a widget. You would have to insert the code calling recent_posts() into your theme.

    If you need further help let me know.

  • 87. Steve  |  June 24th, 2008 at 4:31 pm

    It is possible to have more than one instance of recent posts on a page by passing a parameter string. You can’t, however, do that with the plugin as a widget. You would have to insert the code calling recent_posts() into your theme.

    Thank you – I will continue to research. Can you help with the recent_posts() ? I’m terrible with this coding stuff, but will give it a try.

  • 88. Rob  |  June 24th, 2008 at 9:19 pm

    Steve: I’ll be glad to help out.

  • 89. Steve  |  June 25th, 2008 at 1:49 am

    Okay, totally lost.

    My dev site is at dev.brownstonepark.com, and in the right sidebar has a section called Upcoming Events.

    I created a custom tag called event_start_date and set the value to be yyyymmdd (ensure order) and set it to display ascending for the sort output by. That is not quite working correctly, but I can not figure out how it is sorting (it’s not post date).

    For the above I’m using the widget.

    Can not figure out the code to add to the sidebar.php file to add the second string to pull up only one specific post. I’m going to do a special for CSS formatting and display only one post – always the same post – that will list the current water conditions.

    Suggestions?

  • 90. Steve  |  June 26th, 2008 at 10:25 pm

    Rob,
    Not to push, just wanted to check in with you about my above question.
    Also, once I get this working, I’d like to contribute to you in some way for your time.
    Looking forward to hearing from you.

  • 91. Rob  |  June 27th, 2008 at 10:24 am

    Steve: Sorry for the hiatus — it’s been a bad few days

    Can you let me know some more detail? The output template in particular and how you are setting up the sort order.

    As for the water conditions post… Let’s proceed by stages. First can you place <?php recent_posts(); ?> in your theme to get output (even if not the right output) in the right place?

    Once you have the output in the right place we have to work out what parameter string to pass to get the right output. The parameter system works by starting with the options as set on the settings screens and then making changes. That means you have to handle two aspects: removing any unwanted settings and adding the settings you want to get the water conditions post. Since I don’t know the baseline settings I can only help (right now) by suggesting the parameter string to get the right post. I’d try something like:

    <?php recent_posts(‘limit=1&included_cats=23′); ?>

    where ’23′ should be replaced with the category ID for the water conditions.

    Does that make some sense?

  • 92. Craig  |  July 13th, 2008 at 1:36 pm

    Hi Rob, I’m getting an error when I call Recent Posts:

    Warning: Cannot modify header information – headers already sent by (output started at …

    That’s when using this plug-in: Who Sees Ads ? Manage your Ads, Control Who Sees Them

    Any thoughts?

  • 93. Craig  |  July 13th, 2008 at 2:29 pm

    BTW — it would seem that the plug-in is trying to set a cookie on the lines it’s erroring out on…

    setcookie(‘wp_ozh_wsa_visits’, $visits, $time+60*60*24*365, $url['path'] . ‘/’);
    setcookie(‘wp_ozh_wsa_visit_lasttime’, $time, $time+60*60*24*365, $url['path'] . ‘/’);

    I’m calling Recent Posts on my homepage, which isn’t WP-driven. I’ve no idea why Who Sees Ads is running when Recent Posts v1.3.3 is called, but seems to be having some conflict here.

    FWIW: the Recent Posts output after the header warning/error is still correct.

  • 94. Rob  |  July 13th, 2008 at 9:33 pm

    Craig: You’ve got me puzzled several times over. The current version of Recent Posts is 2.5.0.11 — if there ever was a 1.3.3 it was a long time ago! Are you sure it’s the right Recent Posts plugin? Or maybe it’s just a typo? Tell me more!

  • 95. Craig  |  July 13th, 2008 at 10:36 pm

    Too true Rob! I’m laughing at the mistake there — it’s v1.3.3 of the other plug-in, not yours! Yours is up to date with the same results. :)

  • 96. Maria  |  July 13th, 2008 at 10:55 pm

    Hi Rob,

    I’m trying to have two instances of this plugin on the sidebar. The first will have all the categories but three and the second will show two of the three excluded and at some point, I’ll want to get a separate list for that last excluded category.

    So in other words, here are the lists:
    1. all categories but A,B,C
    2. B,C
    3. A

    List 1 will work, but when I try to do List 2, it prints “None Found.” I’ve tried to do the exclusion call in the first list, then I tried the inclusion call, but neither works.

  • 97. Maria  |  July 13th, 2008 at 11:02 pm

    Nevermind. Stupid me. I had forgotten that in the admin panel, I had already set to exclude B and C, which is why it didn’t show up.

  • 98. Rob  |  July 14th, 2008 at 9:49 pm

    Craig: Have you had any insight from Ozh?

  • 99. Rob  |  July 14th, 2008 at 9:49 pm

    Maria: Easy to do!

  • 100. Craig  |  July 14th, 2008 at 11:42 pm

    None as of yet Rob — seems he’s on Vaca. :\

    I’m not sure where the issue is — I suppose his plug-in.

    If nothing jumps out at you Rob, I guess I’ll just have to wait and see until he comes back in August. humm

  • 101. Rob  |  July 15th, 2008 at 11:09 am

    Craig: I hate it when one plugin developer says the problem is with another developers plugin… so I won’t do that. But the error message happens when Ozh’s plugin tries to set cookies after the page has already sent headers. Maybe that’s something to do with your page not being ‘WP-driven’. (BTW how do you get Recent Posts working if the page is static, non-WP?)

  • 102. Craig  |  July 15th, 2008 at 11:43 am

    Howdy Rob,

    These two lines are all you need to run recent posts on a non-wordpress page:

  • 103. Craig  |  July 15th, 2008 at 11:45 am

    crap — no PHP… um… maybe with the code tag:

    
    <?php require_once("/home/useracct/public_html/wordpress/wp-config.php"); ?>
    
    <?php echo recent_posts(); ?>
    

  • 104. Rob  |  July 15th, 2008 at 2:49 pm

    Craig: I wonder if that unnescessary ‘echo’ might not be the root of the problem? Try removing it (the plugin echoes automatically) and see if the header problem vanishes.

  • 105. Craig  |  July 17th, 2008 at 9:57 pm

    (sigh) — Sadly, no. Still dumping header errors before the results when that plug-in is active. :(

  • 106. jason  |  July 18th, 2008 at 6:27 pm

    download link for version 2.6.0.1 is 404!

  • 107. Rob  |  July 18th, 2008 at 9:34 pm

    jason: It seems to be working OK now.

  • 108. Marco  |  July 20th, 2008 at 12:47 am

    Hi, Rob. Great Plugin. Thank you for your good work.
    Here is my problem: in my first (main) page i want ‘recent posts’ to show me the next 8 posts (i have 8 per page) so people will have an idea of my previous posts in page 2. Everything works OK, but when i go to previous page (page 2), it shows me the same first posts instead of showing me the next (or previous) posts of page 3. Am i doing something wrong? Thanks in advance.

  • 109. Rob  |  July 21st, 2008 at 10:31 am

    Marco: You’re not doing anything wrong — the plugin doesn’t support that kind of behaviour … but it sounds like a very good idea. I’ll see if I can implement it. Thanks.

  • 110. Marco  |  July 21st, 2008 at 11:39 am

    Thank you for you quick reply. I am sure lots of people would like to see this behaviour included in future versions – i know i would! Nevertheless, all i can say is thank you for your good job and effort.

  • 111. Rob  |  July 21st, 2008 at 2:29 pm

    Marco: I think I can see how to do it unobtrusively so when I have a prototype knocked together I’ll send you some code to try out.

  • 112. Michael Jones  |  July 22nd, 2008 at 1:35 am

    Awesome plugin, I love it.

    A quick question – under the filtering options, is there any way to filter out posts which do not have a title? I am thinking it could somehow be done with the custom filter option, but I have been unsuccessful in figuring out how…

  • 113. Rob  |  July 22nd, 2008 at 10:42 am

    Michael Jones: As it stands there is no easy way to catch posts the way you want. You could filter on a custom field if you had one already set up for posts which have no title but that sounds messy.

  • 114. Rob  |  July 22nd, 2008 at 12:38 pm

    Marco: I think the best way of doing what you want is to replace the call to recent_posts in your template with a bit of dynamic code that works out the parameters you want on each page.

    So, instead of

    <?php recent_posts(); ?>

    use

    <?php 
    	$ppl_page = $GLOBALS['wp_the_query']->query_vars['paged'];
    	if (!ppl_page) $ppl_page = 1;
    	$ppl_limit = $GLOBALS['wp_the_query']->query_vars['posts_per_page'];
    	$ppl_offset = $ppl_page * $ppl_limit;
    	recent_posts("skip=$ppl_offset&limit=$ppl_limit"); 
    ?>

    Of course this won’t work if you are using the less flexible widget. Let me know if it works for you.

  • 115. Marco  |  July 22nd, 2008 at 8:19 pm

    Rob, thank you for your quick reply and your code. Almost worked!
    Now what’s happening is this: first page shows the very same posts of the first page: not working.
    From page 2 , etc, it’s working as you expected, showing the next 8 posts of next pages and so on.
    You can see it already in (experimental) action in my blog, Portuguese language only, sorry.

  • 116. Rob  |  July 22nd, 2008 at 9:40 pm

    Marco: You found the deliberate mistake! There’s a ‘$’ missing in the code:

    if (!ppl_page) $ppl_page = 1;

    should be

    if (!$ppl_page) $ppl_page = 1;

  • 117. Marco  |  July 22nd, 2008 at 9:46 pm

    Yes! Working!
    Now i finally can say it´s a perfect plugin! ;)

    Thank you very much for your help and patience, Rob.

  • 118. puneet  |  July 26th, 2008 at 10:24 pm

    hi there
    i just activated ur plugin on my site http://www.usbusinesedition.com but Recent Posts is just not working.

    The recent posts r coming but their link is not coming. all the links r just showing the homepage url. what shd i do? plese help

  • 119. Rob  |  July 26th, 2008 at 10:55 pm

    puneet: Can you submit a bug report from the plugin’s settings screen? That will let me know the options you have set.

  • 120. Hendra  |  July 29th, 2008 at 12:54 pm

    Hey, this is great plugin. Thank you. :)

    I used your “recent post” plugin to my posts, for including “5 related post” in each post based on their tag. My suggestion is, my be you should add an “date option”, so we can including “related post in the past”, not only “related post” like usually. Thank you.

    NB: Sorry if my english is bad, because I’m novice in english language, I’m an Indonesia.

  • 121. Rob  |  July 29th, 2008 at 3:45 pm

    Hendra: Thanks for the kind words! In fact you can already filter the output so that only posts older (or younger) than n days/months/years appear.

  • 122. Hendra  |  July 29th, 2008 at 5:24 pm

    Thank Rob, for your respons.

    About my suggestion, what I mean is: we can embed “related post in the past” on each post. “in the past” here means: based on “current post” date. So, if there is a post with published date: 4 Apr 2008 5:00 PM, then the related post is only displaying any post with published date: before 4 Apr 2008 5:00 PM.

  • 123. Rob  |  July 30th, 2008 at 4:32 pm

    Hendra: I see what you mean. It is on the wish list now.

    If you don’t post many times in a day you can approximate that effect this way:

    
    <?php 
    $post_days = floor((time() - strtotime($post->post_date)) / (60*60*24)) + 1;
    recent_posts("age-direction=before&age-duration=day&age-length=$post_days");	
    ?>
    

  • 124. Rool  |  August 3rd, 2008 at 12:56 am

    Hi Rob,

    I just installed the plugin and add it to my code with this line:

    but now my layout is a bit messed up. I think the width of the plugin isn’t right. Can you see what i’m doing wrong. My site http://wielerprimeur.nl

  • 125. Rool  |  August 3rd, 2008 at 1:26 am

    Is it also possible to add for every new day 1 time above the recent post wich day the articles are posted?

    so that you get this:

    Date (today)
    article 1
    article 2
    article 3
    article 4

    Date (yesterday)
    article 1
    article 2
    article 3

    Date (day before yesterday)
    article 1
    article 2
    etc
    etc

  • 126. Rob  |  August 3rd, 2008 at 11:08 am

    Rool: The output from Recent Posts doesn’t really have a width as such — it just emits what you tell it to in the output template. How that displays is all up to your CSS.

    For the grouped output make some entries on output settings screen: sort by {date:Y-m-d} descending and use {date} as the group output template. You can use whatever you like as the output template for the article items, e.g., <li>{link}</li>

    Good luck!

  • 127. Markus  |  August 4th, 2008 at 9:20 pm

    just what I was looking for! thanks a lot!

  • 128. Rob  |  August 5th, 2008 at 8:59 am

    Markus: Good to hear.

  • 129. Alfons  |  August 6th, 2008 at 10:30 pm

    Hi Rob,

    I use your “Random Post” and the “Recent Post” plugin. Both working fine, but I have a output problem with “Recent Posts”. To display different graphics for each category I use a similar code like that:

    It works fine for the Random Post plugin with 6 categories but if I use {categoryid} with the Recent Post plugin it just return two different category numbers.

    Also is it possible to have a kind of navigation for the Recent Post plugin. I want to show 5 recent posts per page but with the possibility to go further back in the archive. So basically the functionality what you can get with the index.php

    Thanks for your help
    Alfons

  • 130. Alfons  |  August 6th, 2008 at 10:37 pm

    Hmm…the html code didn’t show up….I’ll try it again:

    div id=”postHeader{categoryid}”
    div class=”post{categoryid}”

  • 131. Rob  |  August 7th, 2008 at 11:13 am

    Alfons: Let me work backwards… I answered above what might be a similar question about using Recent Posts to give a glimpse of older posts. I suggested the following code which you might be able to adapt:

    
    <?php 
    	$ppl_page = $GLOBALS['wp_the_query']->query_vars['paged'];
    	if (!$ppl_page) $ppl_page = 1;
    	$ppl_limit = $GLOBALS['wp_the_query']->query_vars['posts_per_page'];
    	$ppl_offset = $ppl_page * $ppl_limit;
    	recent_posts("skip=$ppl_offset&limit=$ppl_limit"); 
    ?>
    

    Basically the code works out the range of posts you want to display and passes that information to the plugin as a parameter string.

    Now for the {categoryid} issue. It is hard to see why Random Posts and Recent Posts should behave differently since the code to evaluate {categoryid} should be from the same file — post-plugin-library/output_tags.php. It’s possible there is a bug in the common code though.

    {categoryid} is an awkward tag! Since categories can be hierarchical and since posts can belong to multiple categories, certain decisions have to be made. I work on the following rules: 1) if multiple categories are assigned to a post the more general ones are knocked out if more specific ones are also assigned; 2) if multiple categories are left choose the first (the numerically smallest).

    I’d like to solve the problem you are having. Can you tell me whether your posts fall in more than one category and whether your categories are hierarchical? It would also help if you made two bug reports — one from the settings screen of each plugin. Thanks.

  • 132. Alfons  |  August 12th, 2008 at 2:30 am

    Hi Rob,
    Thanks for your detailed answer.
    I don’ know way, but the {categoryid} is now working fine for both plugins.

    I still have trouble to use your posted code to have the option to go further back from my posts. If I use it post from just one category and not even the most recent one get shown.
    If I use php recent_posts(); everything is fine, but unfortunately no navigation appears to go to older blog post.

    I also use your similar post plugin (you see I like your plugins a lot :) Is it possible that instead of “None Found” appears if there is no related post, that the hole widget disappear from the sidebar?

    Thanks a lot for your help

  • 133. Rob  |  August 12th, 2008 at 9:33 am

    Alfons: I’m afraid I do not understand what you are saying in your second paragraph. Sorry for being dumb. Can you explain again?

    As for the second question: the answer is not right now. If you use the plugin directly in your theme’s code there is an option to show nothing if there are no results but when you use Similar Posts as a widget the title gets output before the real plugin runs. I will see if I can change the widget code in future.

  • 134. Alfons  |  August 12th, 2008 at 6:10 pm

    Sorry for my unclear paragraph. Well, I basically use your “Recent Posts” in combination with the Exec PHP Plugin to show the latest posts on a page and not in the sidebar. Because I have a totally different layout for the index.php I use your plugin as a simple list for the most recent posts, but I don’t want to show just the first X posts. I basically want the list similar to a default index.php. So a list of post (ie. post 1-5) where I also have a navigation to go to older posts (post 6-10). Hope that’s more clear now…

  • 135. Rob  |  August 13th, 2008 at 2:53 pm

    Alfons: If I now understand you correctly you want to use Recent Posts twice on your page: the first time showing posts 1 to 5 in one particular way and the the second showing 6 to 10 in another style. You should be able to do that — you just have to set the options for one list via the settings screens and change the settings for the second list by passing a parameter string.

    So use the settings screen to get the first list looking the way you want and then call the second one with parameters including ‘skip’, e.g.:

    
    <?php recent_posts(); ?>
    ...
    <?php recent_posts('skip=5&output_template=<li><link></li>'); ?>
    

    I hope I have understood you and that my response makes sense!

    Also, I have made changes to each of the Post Plugins (which I will release shortly) so that the widgets pay attention to the setting to show nothing in the event of no matching posts. Thanks for the suggestion.

  • 136. Alfons  |  August 13th, 2008 at 5:35 pm

    Hmmm. That’s unfortunately not quite that I was looking for. I try to explain it again. If you use a default theme for WordPress, the first page is always a list with your most recent posts and after X posts there is a link to X previous posts and on that page is again a link to even older post …and so on. That’s how basically WordPress works, right?

    So I want replicate the same functionality with your plugin. After X posts there should be a link to previous post … and so on, but I want to use the same page. It should be possible to go back as long as you want…ie even post 560 – 565.
    If I use your suggestion I have to create many pages manually.

    I wish I could show it to you, but the blog is not live yet…

    Thanks for your help

  • 137. Rob  |  August 15th, 2008 at 8:35 am

    Alfons: You might get somewhere combining the two techniques I have shown you so that both calls to recent posts know how many posts to skip based on the page’s query.

  • 138. Thorin  |  August 18th, 2008 at 8:37 pm

    Hi,
    I’m having a problem I believe was not mentioned before. The plugin works great, but the date is displayed wrong: the date for all recent posts is the same, as the date of the post (or page) that is displayed in the main area. For example, one post was published yesterday, another 2 days ago, but when I click on a post, that was published 10 days ago, both new posts have beside them a date of being published also 10 days ago.
    If i format the date output it does the same thing, but if i use date:raw, it displays the correct date for every post.

    Do you have any idea, what could be the reason and how to fix it?

    I’m running WP 2.6 and plugin 2.6.0.1. The result is the same on Windows and FreBSD box.

    Thanks!

  • 139. Sue  |  August 19th, 2008 at 3:28 am

    Hi Rob,
    I have been using post thumb revisited for my recent posts area and am ready to move to your recent posts plug in – which I’m currently using for the featured area. the problem is, when I add the template tag, it indents the image about 5px too far to the right.

    I have no idea why, as I am using it with an identical setup on halfthekingdom (for my featured posts) and it isn’t doing that. At any rate, is there a fix for this? I’m assuming I need to make a CSS adjustment but have no idea what that would be.

    many thanks,
    Sue

  • 140. Rob  |  August 19th, 2008 at 10:02 am

    Thorin: Can you please make a bug report from the plugin’s settings screen? It will help me find the problem better.

  • 141. Rob  |  August 19th, 2008 at 10:07 am

    Sue: The solution really depends on your theme’s CSS. First use your browser to view the pages source. That will show you any classes etc. being applied to the images. Then have a look at the corresponding CSS. If you use Firefox and Firebug that whole palaver is made considerably easier.

  • 142. Lise  |  August 22nd, 2008 at 11:29 pm

    Hello Rob,
    I wrote a littlr documentation about Recent Posts in French.
    http://liseweb.fr/BLOG/utiliser-et-personnaliser-recent-posts

    It would be great, if you would have time to make a pot file for Recent Comments and Recent Posts ;-)

  • 143. Rob  |  August 23rd, 2008 at 8:09 am

    Lise: Consider me nudge and reminded! When I wake up properly I’ll get to it!

    Thanks for the docs — maybe I should re-translate them into English for my site… ;-)

  • 144. Rool  |  August 31st, 2008 at 11:28 pm

    Hi Rob,

    I’ve another question. The recent post plugin is working great by the way!

    But now the new month has started the 1st day of the month doesn’t show on top but on the bottom of the list. for example:

    now it is like this:

    31/8
    30/8
    29/8
    1/9

    It has to be
    1/9
    31/8
    30/8
    29/8

    for a better example please look at http://vtbl.nl

    I’ve sorted the posts first descending on date, and second descending on time.

    Hope you could help me out.

  • 145. Rob  |  September 1st, 2008 at 7:58 am

    Rool: You probably need to sort on {date:raw}. Right now the date format you are using sorts days before months which gives the output you show.

  • 146. Rool  |  September 1st, 2008 at 2:42 pm

    Hi Rob,

    Thnx for your help. It doesn’t solve the problem but i fixed it anyway. It was sorted as {date:d-m-Y} no i’ve sorted it as {date:m-d-Y} and that works fine.

    grt
    Rool

  • 147. Rob  |  September 1st, 2008 at 5:19 pm

    Rool: As long as it’s working!

  • 148. dave  |  September 2nd, 2008 at 4:07 pm

    I have a problem.

    When i try to modify the $default_output_template, there\’s no effect in the page, the output is still the same

  • 149. Rob  |  September 2nd, 2008 at 10:24 pm

    dave: Generally you would want to modify the output template setting. Am I misunderstanding what you want to achieve?

  • 150. Hayley  |  September 2nd, 2008 at 11:02 pm

    Hi
    I am a bit confused as i dont know what template file to edit. I want it shown on the main index posts and a single post. Im not that clued up on html so any help would be grateful. Im normally used to the easy plugins not these ones!

  • 151. Rob  |  September 3rd, 2008 at 8:18 am

    Hayley: See my answer to your comment under Similar Posts.

  • 152. Rashed  |  September 7th, 2008 at 8:46 pm

    Hi,

    How can I call the plugin in the php file. I mean I have a sidebar2 php file which I will use only in the single page and in the Author’s page. So, how can I call the plugin to appear only in these pages. The reason is that in the front page I have sidebar with loads of things and I dont want them to appear in the single page or in the auhor’s page. For this, I need to call the plugin in the sidebar2.php file I have created. How can I do this?

    Plz help me.

  • 153. Rob  |  September 8th, 2008 at 12:39 pm

    Rashed: You just insert the following code at the place in the sidebar2.php file where you want the list to appear:

    
    if (function_exists('recent_posts')) recent_posts();
    

  • 154. Rashed  |  September 9th, 2008 at 1:10 am

    Thanks mate for replying.

    I\’m not sure is it going to show the posts by that author only or it is going to show recent posts from any author.

    Thanks again for the prompt reply. :)

    I love your plugins. :D

  • 155. Rob  |  September 9th, 2008 at 8:25 am

    Rashed: You may need to add a bit of PHP code to get the author and pass it to recent_posts in the parameter string.

  • 156. Joseph  |  September 9th, 2008 at 1:14 pm

    Wow!!! This is what I’ve been seeking for so desperately.
    Thank you sooooo much for this amazing plugin :)

  • 157. Rashed  |  September 12th, 2008 at 10:03 pm

    Alright mate. I\’m gonna try it. :)

  • 158. Artwo  |  September 21st, 2008 at 8:25 pm

    I think the UTF8 conversion doesn’t work with “recent post”. All the accent get wrong for the posts displayed by this plugin. The accents are right with random posts or when I display the index page.
    You can see an example on my site. The firts posts on the welcome page are displayed by recent posts. The 5 next ones by random posts. If you click on “La suite…” you can go on the index page and the accent come back.

    Thanks in advance!
    V 2.6.2.0 for the plugins, V 2.6.2.1 for the library.

  • 159. Rob  |  September 21st, 2008 at 8:49 pm

    Artwo: Can you tell me the output template you are using for each plugin?

    I am puzzled because the two plugins share the same code for generating output so it isn’t clear why they are behaving differently. Maybe the details will help.

  • 160. Artwo  |  September 21st, 2008 at 8:55 pm

    my output template:

    <div class="post" id="post-{postid}">
    <h2 class="storytitle border1">{link}</h2>
    <div class="meta">
    {php: if(function_exists('the_ratings')) the_ratings(); if (function_exists('get_cat_icon')) get_cat_icon('small=true&fit_width=24&fit_height=16&max_icons=2&use_priority=true&cat='.list_icons({postid})); }{categorynames:,}
        </div>
    	<div class="storycontent">{fullpost}</div>
    <div class="feedback">
    {php: comments_popup_link(__('No Comments'), __('1 Comment'), __('% Comments'));}</div>
    	</div>

    I’m using the same for the random posts

    Thanks

  • 161. Rob  |  September 22nd, 2008 at 12:40 pm

    Artwo: Very mysterious! Both plugins call the same function to fill in the {fullpost} output template tag.

    One difference I note is that Recent Posts uses my Plugin Outoput Cache which Random Posts does not. I have just uploaded a new version of the cache plugin (4.0.7) which I hope will fix the problem. Make sure you un-install the old version before installing the new.

  • 162. Artwo  |  September 22nd, 2008 at 5:45 pm

    Thank you!

    It seems to work! I’ll be sure tomorrow after several tries, but at this time, all the accents came back :D

    Thank you for the speed!

  • 163. Isabelle Corradini  |  October 12th, 2008 at 2:57 pm

    thank you for this plugin and for the setup information
    Isabelle

  • 164. Klark  |  October 12th, 2008 at 9:39 pm

    Hey Rob,

    Can you add an option to filter posts so that a post by an author does not appear twice in a list of say 10 posts ? So it would be like recent posts but only one per author.

    Thanks :)

  • 165. Kjetil  |  October 27th, 2008 at 3:40 pm

    Hi
    I have RecentPosts running nicely on our front page (even 3 instances), but I wonder: Is it possible to have another instance of it showing the most recent post (with image) from an other WP installation?
    (For practical reasons different departments of our site runs on separate WP installations – and I’d like the latest post from “dep 2″ on our front page.)
    Thanks,
    Kjetil

  • 166. uepsilon  |  October 31st, 2008 at 10:42 am

    Can you please Help?
    What I’m doing wrong?
    I am using WP 2.6.3 Thank you so much!!!

    Fatal error: Call to undefined function: recent_posts() in /homepages/35/d34000493/htdocs/blog_uepsilon/wp-content/themes/simple_business/second.php on line 11

  • 167. martin  |  November 3rd, 2008 at 11:06 am

    Hi

    I have a single page – which I want to use as an index page with excerpts of several recent posts …. followed by the list of links to posts in category order. On any posts page I want to have a recent posts widget just showing links to the most recent posts.

    I was originally using the recent posts widget that comes as default with wordpress. And had set this up exactly as required for the posts.

    I then set up your recent posts plugin so that I could have some excerpts on my main page. However your recent posts plugin supercedes the default one Ive got as a widget and hence it doesnt seem to be possible to have the recent posts excerpts on Page 1 and just the links (not excerpts or any other of the formatting) in the widget.

    Is thre any way around this?

    Was there any reason for having your plugins widget the same name as the default one? As its not possible to have both in use – yours on page1 and default widget on my posts.

    many thanks

    Martin

  • 168. slobjones  |  November 23rd, 2008 at 8:56 pm

    A couple of issues.

    First, is there any way to set Recent Posts so it displays the posts that the viewer currently sees onscreen? For example, if I’m viewing Page 2 of my blog, displaying posts 6-10, Recent Posts would show those headlines.

    If this isn’t possible, I’d like to at least be able to set Recent Posts in my single.php template so it displays the headline for that entry.

    Recent Comments offers the just_current_post parameter, but this is not available for Recent Posts.

    Second, when I hover over the link created by {link}, it only displays the date — not the title of the post, as it’s supposed to.

    Any reason why this occurs?

    Thanks.

  • 169. Carl  |  November 27th, 2008 at 10:55 am

    Thank you for a really useful plugin.

    Is there a way that the same recent posts list can be pulled onto another non-WordPress page?

  • 170. Fran  |  November 29th, 2008 at 11:41 am

    I can’t even begin to describe how happy this plugin has made me. I spent 2 days just solidly looking through tutorials, asking for help from snarky wordpress moderators, trying other plugins. I can’t believe I didn’t find this earlier. I almost feel like crying, I think you’re my favourite person right now. It does exactly what I want it to and the plugin is built so extensively I can’t even begin to imagine the time and effort you’ve put into this – just to give it away for free to lazy people like me who can’t seem to get the grasp of coding php. Anyway, thank you thank you thank you thank you a billion times, you’ve made my day 50 times over and I can’t really thank you enough!

  • 171. slobjones  |  November 29th, 2008 at 8:43 pm

    [snarky wordpress moderators]

    Fran points up a crying need for some proper WordPress forums or even a WP Listserv.

    The current forums are an embarrassment to all involved.

  • 172. Josh Cohen  |  December 2nd, 2008 at 3:36 am

    Hey Rob – I keep getting this error when trying to access the admin panel on the plugin:

    – Cannot load recent-posts.php.

    I have the most recent version of this plugin and the post plugin library on my wordpress site. Any ideas what could be wrong? Thanks. – Josh

  • 173. Josh Cohen  |  December 4th, 2008 at 6:24 am

    FYI, I was looking around the comments and saw the problem might be my php.ini memory limit. It’s at 32M so that seems like it should be more than enough. I still get the error.

  • 174. Josh Cohen  |  December 4th, 2008 at 6:46 am

    Okay, sorry for the multiple comments. Just tried downloading and installing an earlier version of the plugin – 2.5.0.11 – and it worked. I’m on WordPress 2.5 so maybe that was the problem?

  • 175. Connie  |  December 10th, 2008 at 10:46 pm

    unfortunately the plugin writes “Recent posts” in the title in the sidebar

    I use the actual version but I could not find a setting to define a german title for that, so I had to hack the plugin itself

    this is a pity, many plugins and themes define the output in the code itself and don’t keep in mind that there are more than one language ;=(

    if I overlooked another comment here concerning the same topic, please forgive me, it’s late in Germany

  • 176. juliaL49  |  December 18th, 2008 at 7:59 am

    Connie, not true :-) You can specify the title of the widget (provided you do use widgets).
    Mine says “Neueste Beiträge”.

    BUT: in WP 2.7 posts that are not yet published appear in the list. That is really annoying since it leads to a 404 page.

  • 177. juliaL49  |  December 18th, 2008 at 8:01 am

    Ahem – sorry for the last comment – I checked again and it was a different plugin that lists unpublished posts.

    Very sorry about that.

  • 178. Marv  |  December 18th, 2008 at 6:04 pm

    Is there any Way – i show Gravatars also – to show an defined other gravatar then the one from gravatar.com (the man in grey)

    For Comments @ posts i have allready an other Pic instead of the standrad gravatar..

    THX Marv

  • 179. Embun  |  December 28th, 2008 at 3:06 pm

    Hi Rob,

    Thank you for the great plugin series. Good job.

    FYI:: When I enter to the ‘Filter’ setting page, I found this error message:

    
    Warning: str_repeat() [function.str-repeat]: Second argument has to be greater than or equal to 0 in /home/tetesemb/public_html/wp-content/plugins/post-plugin-library/admin_common_functions.php on line 598
    

    Thereis 7 replications of that message on ‘Filter’ page, and it’s happened on all the plugin-filter-setting page.

    They’re shown after text ‘Categories to exclude/include:’ and before list of categories.

    What is happened, and how to solve that ?

    Filter setting is normally. Running well, but what is the error mean?

    Thank you. Jesus love us.

  • 180. Eclipseon  |  January 2nd, 2009 at 4:18 am

    Hi,

    Firstly, thank you for creating such an awesome plug-in! Unfortunately for me, I can’t seem to get the plug-in to work exactly the way I want it to. For example, I am trying to alter the code so that my recent posts display such that 2 are on the left and 2 are on the right, creating two separate columns. Is there any possible way for me to do this?

    Thank you!

  • 181. juliaL49  |  January 2nd, 2009 at 8:29 am

    Hello it’s me again (comments #176+177).
    And after just saving a draft it showed up in my recent posts list.
    That is annoying since I often write posts over several before pubslishing them.

    Any ideas?

  • 182. O'Brien  |  January 10th, 2009 at 12:04 am

    I’ve got code appearing in the display of a user name

    John <span id="high_3" class="searchterm3">O’Brien</span>

    How do I strip or prevent that?

    Thanks

  • 183. Paul  |  January 13th, 2009 at 2:48 am

    Love the plugin, is it possible to have the excerpt display with html formatting, the way the {fullpost} does?

  • 184. Daniel  |  February 7th, 2009 at 12:39 pm

    1- Can I have previous / next link ?
    1a- and without page refresh

    2- Can it show snippets of the recent posts ?

  • 185. Amanda  |  February 12th, 2009 at 4:59 pm

    I am using the Recent Post plugin, however I don’t see an available tag to place a link for the recent post comments, or posting a comment. Please let me know if there is a tag for this in the Recent Post plugin… all I see is the {commentnumber} or something like that

  • 186. juliaL49  |  February 25th, 2009 at 7:59 am

    Again about the draft issue.

    Since Rob seems so be overwhelmed by the success of his plugins I have added a few lines myself. I wrote about it on my blog. It is in German thought but if anybody wants the details I can translate the post.

  • 187. Bob  |  February 25th, 2009 at 3:41 pm

    Im using a page as a static frontpage, now i would like do display the 5 last posts on this frontpage, but i cant get it to work, do you have any ideas?

  • 188. spcaer  |  March 1st, 2009 at 7:02 pm

    When will the newest version come out that is compatble with WordPress 2.7.1?

  • 189. Chris  |  March 9th, 2009 at 7:54 pm

    Hi. Can this plugin support WordPress MU? Meaning, can I use it to aggregate recent posts across all my WordPress MU blogs? If so, can you please advise how? Thank you.

  • 190. Daniel  |  March 13th, 2009 at 6:28 pm

    I’ve just installed this plugin, it works just half.
    The recent posts titles are showing up in the sidebar, but when I want to customise the plugin I got an error message: Can’t load the recent-posts.php.

    worldpress 2.7.2

    thanks for helpful answers

  • 191. Lori  |  March 26th, 2009 at 11:35 am

    I am thrilled to find this plugin, it allows the customizing I need to satisfy a very picky designer. I’ve got things pretty much as needed, but I can’t seem to remove the date from the bottom of the excerpt, designer wants it above. this is my output template

    {date}
    {title}
    {excerpt:30method:more:link}

  • 192. Lori  |  March 26th, 2009 at 11:47 am

    Hi again,
    With a little more playing around with the output the date is now where we want it, but the “more” link is not working. I know I’m overlooking something simple here……

    Thanks!

  • 193. Trevino  |  April 17th, 2009 at 10:12 am

    Hi, Great plugin that makes WP more like a true CMS.

    Is there is a way to sort the posts alphabetically?

  • 194. Max  |  April 24th, 2009 at 8:20 pm

    Hi! Thanx for a great plugin!
    I’ve used some of the code

    post_date)) / (60*60*24)) + 1;
    recent_posts(“age-direction=before&age-duration=day&age-length=$post_days”);
    ?>

    to use on my site – i’ve tried to make it display recent post from the days before – here is the code:

    $post_days = floor((time() – strtotime($post->post_date)) / (60*60*24)) + 1;
    recent_posts(“age-direction=before&age-duration=day&age-length=$post_days&limit=3&output_template={link}”);
    $post_days = floor((time() – strtotime($post->post_date)) / (60*60*24)) + 2;
    recent_posts(“age-direction=before&age-duration=day&age-length=$post_days&limit=3&output_template={link}”);
    $post_days = floor((time() – strtotime($post->post_date)) / (60*60*24)) + 3;
    recent_posts(“age-direction=before&age-duration=day&age-length=$post_days&limit=3&output_template={link}”);
    $post_days = floor((time() – strtotime($post->post_date)) / (60*60*24)) + 4;
    recent_posts(“age-direction=before&age-duration=day&age-length=$post_days&limit=3&output_template={link}”);

    But something is wrong – and i don’t know how to repair it..
    Can you please help? (Ex. today – 20, yesterday 19 and so on..)
    1. it gets the time of the current post,so if i want to show post from yesterday (19) i have to be on the main page or on the page with the post that was posted today (20). If i open post that was posted on 15th – plugin shows posts from 14th – that’s wrong :(
    2. is it possible to make it show post only from current date? Because if i have limit 3 and i had only 1 post yesterday it will show 1 post from yesterday (19) and 2 from 18.

    I hope you can help…

    Thanx, Max

  • 195. marv  |  May 6th, 2009 at 12:37 pm

    thank you! it also run at versio 2.7.1 :)

  • 196. NiTRo  |  May 8th, 2009 at 12:07 am

    Hi, it’s a very nice plugin but i’d like to limit the length of the title links to 40 chars. Can someone help me to do this ?

  • 197. Vietze  |  May 9th, 2009 at 2:07 am

    printer’s problem with {image} (as well as latest plugin version, I had to downgrade to version 2.6.0 to get this plugin to work at all) are EXACTLY the same as mine. I did a little CSS workaround that worked very nicely for me and was simple to execute.

    Rob, none of your solutions worked at all for me. {image:width:height} did not work, it just printed it instead of displaying the image.

    Here’s my fix.

    Create a div ID in your CSS stylesheet as follows:
    #myrecentthumbs li img {
    width: 180px !important;
    height: auto !important;
    }

    This will force all images displayed as line items in the div to size down to whatever size you want.

    In your options page, you would then add the surrounding divs to your {image} tag as follows:

    {image}

    Voila. It works! So happy to have found this plugin. Post-thumbs-revisted (which I also used before) really isn’t up to par and simply stopped working one day. Creating actual thumbnails is a real hassle for people who don’t know how to, or cannot access, their php.ini files to adjust memory limits. Always has been a bit of a problem for me even considering I know what I’m doing!

    I LOVE THIS PLUGIN. Very very very sweet, thoughtful and easy to use. Great work Rob.

  • 198. Kjetil  |  May 27th, 2009 at 8:51 am

    Urgent:
    Can anyone tell me if this plugin is compatible with WP 2.7.1? Or even 2.6.5?
    I run WP 2.6.2 and have just been hacked so I need to upgrade – and eventually look for a replacement plugin.
    Would be too bad since both this and Random posts work great.

    The plugin is said to work up to 2.6.2 – and it seems like people have different experiences… Any updates, Rob?
    Thanks,
    Kjetil

  • 199. Monkeyboy  |  May 30th, 2009 at 12:21 am

    Yeah, this is a great plugin, and would love to know if it’s still getting updated. On the WordPress site, it says something like 150 days since the last update…

  • 200. Asaverle  |  June 11th, 2009 at 1:08 pm

    Hi Rob, first of all your plugin is excellent. But, I have a problem wiith the thumbnails. They show up correctly but there is a slight problem at the surrounding frame. I suppose it is a css prblem but i just can’t find the solution. You can have a look at my site’s footer and u will understand what I am talking about.

    Thanks
    Nikos

  • 201. Asaverle  |  June 12th, 2009 at 9:37 am

    Nevermind, found the solution, had to edit style css in widget.img . yeah!!! works great! thx again for this fantastic plugin!!!

  • 202. Arthur Agin  |  June 22nd, 2009 at 11:23 pm

    I am redesigning my website so some pages are WordPress and the galleries are hosted on SmugMug. Is there a way to use this plugin on the Smugmug site and display the recent entries from the WordPress blog?

    Thanks.

  • 203. hb  |  July 9th, 2009 at 3:46 am

    I used your plugin but post title won’t link to the actual post. they are like link but don’t go anywere and stay on the same page . When I looked at the source the herf is empty: href=”"

    Also {url} comes up blank.
    Would you help me out to fix it. I have same problem on 3 different wordpress

  • 204. Jornes  |  September 10th, 2011 at 10:05 pm

    Hi Sir,
    I’m using your plugin( recent post 2.6.2.0)
    I would like to know how to make my recent post only appear 5 post for maximum on my page?

  • 205. morrisjfwong  |  July 20th, 2013 at 3:13 pm

    Great plugin … tried this long time ago and works well. Thank you so much for these efforts.

  • 206. Rocktivity  |  September 6th, 2013 at 4:12 am

    How do I turn this into a widget? What do I put in the placement section of the setting page?

Leave a Comment

Required

Required, hidden

Trackback this post  |  Subscribe to the comments via RSS Feed