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.
[box style=”notice”]An enhanced version of this plugin is available from Code Canyon.net[/box]
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.
Pingback: Simple Recent Posts Widget | Pippin's Plugins
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.
Pingback: How to create WordPress Widgets | WP Roots
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.