Featured Posts In Sidebar In WordPress
I recently decided to add a “Featured Posts” widget to the sidebar of my blog. My original assumption was that WordPress would have something that could do that from the outset, but I was surprised to find it doesn’t.
But then I was sure there’d be a plugin that could do it. There are, but I was disappointed by every single one of them: Some didn’t install. Some installed and then did nothing. Others installed but didn’t provide a widget, assuming you’d want your featured posts embedded somewhere in your template.
In the end I gave up and thought about the problem laterally until I came up with the following solution: Rather than finding a plugin that tried to do everything for me, I figured I could just use a plugin that shows posts from a category. That way, all I need do to “feature” a post is put it into the relevant category.
Category Posts Widget
There had to be a plugin that could show posts from a specific category in the sidebar. There was, and it was called Category Posts Widget. Simply install this and your WordPress installation will gain a new widget as shown in the screenshot.
As with any widget, drag it into the sidebar area on the right, and then click the arrow to configure it.
But before you configure the widget, first create a new category named, say, “Featured” and add any posts you want to feature into it. This is most easily done by going to Posts > Categories in the menu.
Once you have your new category add the widget to the sidebar and configure it to use the new “featured” category and you’re away. Feel free to change the title of the section as it appears in the sidebar, how many items to show from the category, etc. This widget is quite powerful in that you can choose how to order the articles: Chronologically, randomly, by number of comments, … You can also decide whether you want to show excerpts and thumbnails or not.
Fiddle with the options until you’re happy with the way your new featured posts widget looks.
That’s all there is to it! Now you just need to write some feature-worthy content! Hope that helps somebody.
This post is old. Over 5 years old at my time of writing this addendum. I’ve not tested the plugin discussed above since I wrote the article and I’ve had at least one person report that said plugin no longer works as expected. So you might not want to trust this particular method. If I find time perhaps I will pen a follow-up post that discusses an alternative method.
Despite the post’s age it is, for whatever reason, suddenly getting a lot of attention from people who seem to be expecting some sort of programming tutorial. This post is not intended as any kind of programming tutorial; it is aimed at non-technical people who own their own WordPress blog and who are trying to work out a way to add a list of featured posts to their website. Even if the method doesn’t work perhaps the thinking behind it will at least highlight a way forward for someone who is otherwise at a dead end.
I will happily publish polite constructive criticism from people who have the courage and conviction to use their name and email address to offer such criticism. But I will not publish verbal attacks against me, my writing or my work based on a post – that was written over 5 years ago – simply because you read into it an intent that was never there: Aside from this addendum the words “programming” and “coding” do not appear within this article. If you clicked into the article expecting a coding tutorial then I’m sorry that you made an incorrect assumption. But I won’t change legacy articles simply because of how they made you feel.
As I have already stated in a comment, “[if] you [leave] a polite comment asking for pointers on how to write a widget or even a blog article on that subject I’d [be] happy to oblige”. But people persisting in posting anonymous comments that are unconstructive, rude, or telling me how I should title my posts don’t fill me with a desire to help humanity for free, they fill me with a desire to disable the comments on the post.
So if you came here assuming this was a programming tutorial and instead found a 5 year old exercise in code reuse, don’t waste your time sending me your hate. Hit the back button, write off the 30 seconds you spent skimming the article, and chalk it up to experience.
To everyone else, I hope you at least found some use in the thinking behind this article.