How to Add Sticky Posts for Categories in WordPress

23

Sticky posts allow you to add featured posts in WordPress and display them differently on your site’s homepage. Recently one of our users asked us how they can add sticky posts in category pages. By adding sticky posts on category pages you can display featured posts from that particular category. In this article, you will get to learn how to add sticky posts for categories in WordPress.

A sticky post on a category page

First thing you need to do is install and activate Category Sticky Post. There are no special settings page for the plugin. Simply create a new post or edit an existing one, and you will be able to see a new ‘Category Sticky’ meta box in the post edit area.

Making a post sticky in a category

Next, simply choose the category where you want this post to be displayed as a sticky post and save your changes.

If you want to set another sticky post in that category, then you will have to uncheck category from the earlier sticky post. It is not required for a post to be filed in the same category. For example a post filed in Announcements category, can be made sticky in the News category.

Each category can only have one sticky post at a given time. Also each post can only be sticky for one category.

By default the plugin adds a black border on top and bottom of the category sticky post to distinguish it from other posts. You can disable it by checking the Hide Sticky Post Border checkbox. When this box is not checked the plugin adds a category-sticky class to the category sticky post. You can override this in your child theme’s stylesheet.

  .category-sticky {   border:none;  background-color:#f5f5f5;  }

We hope this article helped you add sticky posts to your WordPress categories. For questions and feedback you can leave us a comment or join us on Twitter.