WordPress comes with a Recent Posts widget that you can use to display a list of your latest posts in your widgetized sidebar, but it’s really not very good in the fact that it does give you any control over your posts at all. So I’ve written a new one.
An enhanced version of this plugin is available from Code Canyon.net
This is a very simple plugin, but it gives you much better control over your widget display.
Plugin features include:
- New Recent Posts Widget
- Widget Title Option
- Option to control the number of posts displayed
- Option to control the posts offset
- Ability to enable post thumbnails
- Thumbnail size option
- Choose the post type to display
If you’d like me to write a tutorial on how to make a widget like this, let me know in the comments!
Change Log
v1.1 - added ability to choose which post type to display v1.1.1 - fixed a bug with post type detection v1.1.2 - added category selection v1.1.3 - fixed bug with select field options vanishing v1.1.4 - fixed offset bug and post type bug in posts queryDownload



So simple.. But so cool! Nice one!
Thanks! I hope you find it useful
Nice and simple widget…good idea
Nice plugin thanks. A useful addition would a class field for some custom css.
Would you like to see that within the widget settings?
Great idea and your plugin looks nice!
A question: In the settings I see you can set the thumbnail size. Will that also work for existing images or only for images that are newly uploaded?
It will work for all images.
Great! And thx for your fast reply
Let me know if you have any suggestions or problems!
Can you make it select category?
I will see if I can update it sometime soon for that.
Hi Pippin
Nice and simple plugin! Thanks.
Do you think it’s possible to choose a custom post type in the post selection drop down?
That would be pretty awesome if so. For example, I have a site that displays apartments and flats, it would be really good to include the widget on a property page and show ‘the last 5 properties added’ or something. How ever the property page is a custom post type.
Hope that makes sense.
Thanks Mark
It already has that function
Haha. I can only see these options in the post type?
http://dl.dropbox.com/u/1488367/brr.jpg
What is your post type called?
property_guide and there’s 2 more that I created with ECT
Ah, interesting. You have found a bug in one of the plugins for sure. I just tested it and post types created in ECPT do not show up in the drop down. I will see what I can do about it.
Great stuff. Thanks Pippin. Have a good weekend.
@Mark, I have fixed the problem. It was a small bug in this plugin. I’ve uploaded a new version with the bug fix. You can download it here.
Awesome! Thanks for the swift response Pippin.
Do you have any screenshots of how this will look on a blog? I can’t find any…
It will look exactly like any other widget on your site. It has been built to integrate perfectly.
I would also love to see category selection added.
This is a GREAT plugin, thank you!
@Dusty – I will see if I can go ahead and add category selection when I return from my trip.
Hi Pippin, great plug-in but for some reason it does not show any thumbnails in the list and the choose post type box seems to have frozen?
@Laurence – the thumbnails require that the posts have a featured thumbnail set, it does not automatically detect images placed in the post.
I have noticed the freezing as well (or rather a blank select menu) but have not found a solution. I will post an update when I find it.
[...] with Widgets Series is going to show you how to create a simple recent posts widget, much like my Better Recent Posts Widget plugin, though it will be even simpler. The goal of this tutorial will be to demonstrate a very [...]
Not sure what’s changed recently but the “skip posts” option now doesn’t appear to do anything… was working fine up until today (4th July 2011)
Any suggestions?
…sorry, some more info:
WordPress 3.1.4
Better Recent Posts Widget 1.1.3
@Phil and @denise_kc – The offset issue has just been fixed. You can download the new version from the download button on this page.
I LOVE your plugin – and REALLY LOVE that you live in Lawrence (I’m in KCMO!) I am prob making a noob mistake, but the offset is not working … no matter what # I type in, the most recent post is appearing. any info you can pass on is much appreciated – thanks again!
tem como colocar como shortcode?
colocar para exibir em determinado ligado do layout
sem usar widgets???
Obrigado!
Widget coming soon
Hey there,
I just purchased Better Recent Posts and would like to be able to keep the css look of the original WP recent Posts look. For example I would like the title of the post to be a heading (H3) or something.
here’s the site (http://jollytours.ca/category/contact-us/)… I would like the sidebar using “Better Recent….” to look like the footer using WP recent comments.
Is this possible. Any help at all would be greatly appreciated.
Thanks
@Matt – are you comfortable getting into the code? I can show you where you need to make changes.
[...] While I have left the output to nothing more than simple text messages, you can just as easily use the options to control a post query, just as I did with my Better Recent Posts Widget. [...]
Hey friend,
I loved the plugin. Thank you for developing it. Keep up the good job.
Great plugin! Has anyone noticed that if I set a category ID, the plugin ignores how many posts I set it to display? Eg if i set category to 6 and posts to display to 4 it displays the correct category, but shows every post I have in that category. Bug? or am i doing something wrong?
Jeff
@Jeff – are you using the free or premium version?
oh I didnt know there was a difference? LoL let me look around for it.
Is there a way to get rid of the “# days ago” below each post title? I didn’t see an option anywhere and I couldn’t pick it out of the code.
@Dennis – The $4 pro version has an option for this. If you want to stick with the free one, though, you will have to remove it from the code.
I figured it out. I just removed the “time” span. Thanks for the great plugin.
As per someone elses comment earlier, when you define a category the number of posts to show no longer works. (i.e. if I dont define a category and define it to show 1 post it shows only the latest post in all categories. When defining a category it shows all posts no matter how many I set it too). Is this a bug?
@Jenni – Hmm, I’m not able to replicate this. I’m uploading a new version right now that may fix the problem. Please redownload it (from here, not the plugin repository) and let me know if it’s fixed.
Thanks for the prompt reply. I have just installed this (downloaded from this page v1.5) and the moment I add a category ID it ignores the number of posts still. (It shows 6 posts rather than the 1 specified).
@Jenni- Strange. What version of WP are you running?
Im using WP 3.2.1. I notice Jeff on 4th August said he was getting the same error (comment 38)?
@Jenni – Yes, and the reason was never determined. Let me look through the code again and see if I can find why this is happening.
@Jenni – Okay, I’ve made another change. Try downloading again.
Thank you for being so helpful
Its still not working though Im afraid! I am resetting the sidebar as well (deleting the widget and re-adding) to make sure its not remembering anything.
@Jenni – I wish I knew what was going on here. Would you be willing to share login info with me (via my email)? If so, I can login and take a closer look.
Yes no problems. The site is currently running locally – its nearly finished so Ill get everything else up, make it live to the server and send over the login details. Thanks for your help
@Jenni – Cool, just send it to me in an email when ready.
Hi Pippin, the site is now live. Whats your email address?
@Jenni – go to my contact page.
Hey, Pippin! How do I get rid of dates on the widget? If I’m posting only a certain category, I don’t want to show that the post is older, if that makes sense. Thanks!
Ashley
@Ashley – That’s a feature available in the pro version, which you can pick up here for $4.
Thanks! I downloaded the Better Related Posts widget for $5, but I think it’s the wrong one. If I download the Better Recent Posts Pro widget, do I have the option to leave out the dates?
@Ashley – Yes, the Pro version has the option to hide the post dates. How did you pay $5 and download the wrong one?
Okay, I downloaded the pro version. Is there a way I can display posts from only a certain category, instead of the recent posts? In the free version, we were able to put in the category ID, but I don’t see that in this version. Thanks!
It’s a great widget!
Oh, just saw your question – I searched for your widgets, and that was the first one that popped up, and the titled looked similar, so I thought that was the widget you were talking about. Oops. Oh, well!
-Ashley
Yeah, I can’t seem to be able to get a single category to post, instead of just the recent posts. Any help would be greatly appreciated. I have the category ID. Thanks!
@Ashley – See the option for “Taxonomy Term IDs to Display Posts From”. Enter the category IDs there, and make sure you select “category” above. Also, please ask any further comments related to the pro version here
any way to select multiple post types? I have 4 CPT’s I want to display, but don’t want 4 widgets.
@Brian – No, but I may be adding that feature to the Pro version some time soon.
[...] While I have left the output to nothing more than simple text messages, you can just as easily use the options to control a post query, just as I did with my Better Recent Posts Widget. [...]
Hi Pippin,
I really like this plugin, so simple but really effective. Thank you.
I’ve made an small update to the source code that was really crucial for me, and I thought I’d share incase others were looking for the same thing. It’s just an extra field for thumbnail height (the designs I had didn’t feature square images). I added timthumb to the directory to display the new sizes. It’s a really simple update and just add’s that extra bit of loveliness to the plugin. Let me know if you’d like me to email the updated version to you.
Andy
@Andy – Cool, thanks! Why don’t you go ahead and post instructions here for anyone else wanting to make the modification.
Hi Pippin and Andy – The ability to resize the thumbnails and not only have squared dimensions would be great. Can you guys post the solution on the comments so that everyone can benefit from it? Thanks a lot for your work!
@Jay – Andy did that update on his own, so if he’s willing to email the code to you, fantastic. Andy, if you want, go ahead and email it to me and I will publish it here.
I bought pro version from Code Canyon two days ago.
I’m sending extra thumbnail (50px) to wordpress with database manipulation.
(to wp-posts table as post_type=attachment )
How can I use it for side bar widget.. I’m using recent posts pro for both main content and sidebar.
Best regards
I’m not quite sure what you’re trying to do. As long as the image is set as the Featured Image on the posts, it will work fine.
[...] Better Recent Posts Widget [...]
This an awesome plugin, thanks for making it available. Quick question if you have time, do you know if there is anyway to have the dates removed from the bottom? Keep plugin away
The Pro version of the widget includes an option to show/hide the date. If you want to keep the free version, then you will have to modify it yourself. The pro version is here: http://codecanyon.net/item/better-recent-posts-widget-pro/318193
Hy,
I have Post type called News. The News will be in English and German. Is it possible to display English news in English page and German news on German page.
Regards.,
Vivek
You will have to use a multi language / translation plugin to do this, but yes, it should be possible. Take a look at the qTranslate plugin.
your plugin didn’t display thumball on my site using WordPress 3.3.2. Pls fix it. Thanks
P/s: I’m waiting your fixing.
Are you using the “Featured Image” for setting the thumbnails?