Howto: “Featured Posts” Widget In WordPress

How to add a ‘featured posts’ widget to your WordPress blog.

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.

Category posts plugin screenshot - Howto: “Featured Posts” Widget In WordPress

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.

add new category screenshot plugin - Howto: “Featured Posts” Widget In WordPress

featured posts screenshot plugin -Howto: “Featured Posts” Widget In WordPress

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.

 


UPDATE 09/08/2017:

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.

About Matt Lowe

Matt Lowe is a WordPress web designer / developer based in Newbury, Berkshire. After 8 years of doing the nine-to-five for other companies and watching them make the same mistakes over and over he set out in business on his own, forming Squelch Design to help businesses get online and make money.

16 comments on “Howto: “Featured Posts” Widget In WordPress

  1. Pingback: 19 Awesome WordPress Plugins To Supercharge Your Blog

  2. Hi Matt, I did exactly the same research as you did, I searched a nice widget plugin all over the web and found nothing. I even tried to make it myself. Thank you for this idea with Category Post Widget! Actually I redesign my home page and I’m going to try this plugin right now :)

  3. One: You’re not showing how to ‘create your own featured posts widget’, you are just showing how to use somebody elses.

    And two: It’s not a featured posts widget because you can’t feature the posts, just the category.

    Very annoying. Try doing some actual coding.

    • I’m going to allow your comment because I think I can use it as a useful teaching aid. However, if you want to leave further comments I suggest you use a real email address instead of using that field as a place to insult me which is, frankly, unnecessary. And then of course we can have a proper discussion on the matter, instead of you hurling cowardly abuse and then running away.

      The fact that you’ve got so angry over a useful blog post shows your ignorance, especially through your first point: What this tutorial does is show you how you can use lateral thinking to create a featured posts widget. Presumably what you came here looking for was how to code a featured posts widget. Nowhere in my article did I say I would be teaching you how to write a widget, and the general audience for my blog would not understand such an article anyway. By writing the article you were clearly expecting to find here I do no favours to my audience or to myself. Just you. That said, had you left a polite comment asking for pointers on how to write a widget or even a blog article on that subject I’d have been happy to oblige, but I’m less inclined when you throw insults around.

      So to answer your first point, I am in fact showing you how to create your own featured posts widget, and indeed showing you how to use somebody else’s. The two aren’t mutually exclusive. How? Because the terminology here is vague and you have shown your ignorance by assuming that the word “widget” refers to one thing and one thing only. In fact the WordPress lexicon is at fault here because it does not distinguish between the class, the abstract entity and the concrete implementation.

      To clarify: “Widget” can refer to a PHP class that tells WordPress to create a widget you can then see in the administration interface, and determine how it should function; It can also refer to the draggable box you see on the left hand side of the “Widgets” screen, which you can drag over to your sidebars on the right: This is the abstract entity that you can (usually) create multiple instances of, it has no configuration and on its own does nothing; And then finally there’s the concrete implementation that goes into your sidebar: Typically you can make as many copies of the abstract entity as you like, adding them to your sidebars as concrete implementations, each with a position in the sidebar and associated configuration or content. Only the concrete implementation has an affect on your website, this is what people see on your blog.

      Note that I’ve made up the phrases abstract entity and concrete implementation, borrowing from the relevant computer science theory where appropriate, because as far as I know WordPress doesn’t offer a name for these. It probably never will either because most people don’t care or need to understand that there’s a distinction. The only reason for offering different names would be to prevent the kind of confusion you have suffered.

      I’m not sure what you’re trying to get at in your second point. I’m not sure what your idea of a featured post is, perhaps your idea is different to mine. Or perhaps you didn’t read the article fully.

      And your final point, “try doing some actual coding”: Oh I do. I spend all day every day coding and I make my living from it. I even give some code away for free, such as my free comment spam filter. But one of the most fundamental principles in computer science is DON’T REINVENT THE WHEEL. If you can achieve the result you want without writing code then it makes sense to do so. If you can borrow and reuse existing work then you should. If you can use lateral thinking to bend existing work to your whim then you should. And that’s what this article is all about: Using lateral thinking to achieve your goals. I’m sorry that you missed the point.

    • Old post is old, but I do somewhat agree with the angry person.

      HOWEVER, your reply also makes many valid points. I came here looking to see how to write your own related/featured posts plugin, and I stumbled upon the great one you describe – only issue is that right now it does not work for some reason and won’t let me activate, but whatever. I will look for older versions.
      Either way it is a step in the right direction, but with a somewhat misleading description.

      I was more so looking for how to write my own for learning purposes, but this will work for now!

      As for the angry guy/girl/nonbinarysomethingorother: when you search for info online and don’t find what you are looking for, hit the back button and go to the next link on your search engine … it is that simple. No need to insult someone’s clearly helpful post.

  4. Thank you so much. I just gave up and used recent posts when I found this plugin. Thank you.

  5. Well put, and informative to boot. ~AND~ thank you for the spam filter! We are grappling with that particular issue at the moment. I will be sure to try your featured post solution when I have my other blog going. :)

    • Hi Ellen, hope you get on with Unspam! I don’t get much feedback on that plugin so I’d appreciate it if you could let me know how you get on. Note that it doesn’t (yet) keep any statistics on spam prevented so you might not realise just how much pain it’s saving you from as it quietly sits in the background doing its thing. This blog was receiving more than 14 spam comments a day with another spam filter activated, that number dropped to 0 since installing Unspam, with the exception of a handful of hand-submitted spam comments. I’m still thinking about ways to deal with that particular issue :)

  6. Hi,
    It’s an amazing bit of information, and I found it useful. But I faced with a small problem. I think some padding setting is on. A small space is displayed before the title of the post. How to get rid of it? Can you please guide me

    • Ah I see, you’ve got a conflict between:

      #category-posts-2-internal .cat-post-item:before

      and

      .widget>ul li:before

      The latter contains

      display: inline-block !important;

      Which overrides the first’s rule of

      display: table;

      I believe you should be able to fix this with a new CSS rule of:

      #category-posts-2-internal .cat-post-item:before {
          display: table !important;
      }

      This is an example of why the !important tag is bad.

Leave a Reply

Your email address will not be published. Required fields are marked *