Category Sticky Post For WordPress

Category Sticky Post

Category Sticky Post for WordPress is a plugin that allows you to mark a post as sticky within a specific category archive. It works exactly like the typical sticky post functionality within WordPress, except that it’s specifically for category archives.

This means that if you have a set of articles under one category, you can mark one to always appear at the top of the category archive.

I’ve written and released a similar plugin – Tag Sticky Post – which came out of a need for my own site. But we all use categories and tags differently. As such, I wanted to make sure that I covered both types of archives.

The problem that the plugin attempts to solve is the same as that of Tag Sticky Post. Directly from that project’s post:

The problem is that I often write a post introducing the project, what it does, why I wrote it, and where you can find more information about it. But over time, I write posts that cover various updates or other issues about the project ultimately pushing the introductory post – arguably the most important post – lower into the archive.

Category Sticky Post has the following set of features:

  • Allows you to select which category in which to stick a post
  • Will display the post on the top of the first page of the archive just like built-in sticky posts
  • Will only allow you to stick a single post per category
  • Displays whether or not a post is stuck in a category on the Post Edit dashboard
  • Provides light styling that should look good in most themes
  • Is available on each post editor page
  • Is fully localized and ready for translation
  • Includes Spanish translations right out of the box (thanks to Andrew Kurtis!)

Be sure to check out a variety of screenshots, too.

Thanks to FirstSiteGuide for providing a set of translations for the plugin, as well. They focus on building an online presence and have written a couple of guides related to WordPress, as well.

For the plugin, you can install it from the WordPress Dashboard or download it from the plugin’s homepage.

122 Replies to “Category Sticky Post For WordPress”

  1. This plugin is exactly what I was looking for, but it doesn’t seem to be working for me…. I have defined what category the post should be in, and assigned the sticky post to that same category, but all of my sticky posts are showing at the top of all the categories. Is there a certain way I need to be calling for the Sticky Post in the category.php file that perhaps I am missing? Thanks!

          1. The idea is to have 45 different articles and each goes to a different categories. For example: post01 stick in top of category01, post02 stick in top of category02, post03 stick in top of category03 and so on. Then, of course, new posts will be in each category in chronological order, as usual.
            Sorry again for my brutal english…

        1. Great plugin, thank you very much. Only thing is that if I edit the plugin stylesheet, won’t it get overwritten in the next update? I tried to add it to my child theme stylesheet but it didn’t work. Would you have any advice?
          Thank you

    1. I’ve just found the answer. The categories displayed should have articles, an empty category won’t be displayed.
      Thank you dear and thank you for this good job
      isabelle

      1. Tom,
        Sorry for the slow response. I didn’t realize I hadn’t confirmed the subscription in my email so I just got your message. Good news – I deactivated JetPack because it was causing problems with another plugin and it fixed my Sticky Post problem too. Thank you for the help.

        abi

  2. Hi Tom, We’re doing ‘Category Podcasting’ with WordPress, and I’m just wondering if I use this to make a post sticky, what will it do to the RSS feed, will it always make the top item in the feed the sticky one? However I don’t want this, I want the top sticky simply for information about what the podcast is about for this particular podcast series.

  3. Hi, this plugin works almost perfectly. If I change the product and store the specified sticky category is deleted. So I need to save again after the item category and specify save the sticky.

    Is that intentional?

    Thank you
    Jochen

    1. It’s not exactly a bug, it’s just a less than desirable user experience :).

      This has to do with the way that the plugin is managing those categories. I’ll make a note of this and see if I can resolve it in a future release.

  4. Hi Tom

    This plugin was exactly what I need, so I installed it and it worked as described. The only trouble is that my menu items in the menu admin page became “frozen” ie they can’t be pulled up and down and no dropdown menu items can be added. This happened on three themes I tried, Slide, twenty-twelve and Suffusion. Is there a workaround please, as I would like the functionality of your plugin.

    Thanks
    Vic

    1. Hey Vic,

      This sounds like it may have to do with another plugin as Category Sticky POst was tested with Twenty Eleven, Twenty Twelve, and Standard during development. There’s also only CSS changes that have been made – no JavaScript that would interfere with a menu.

      This is also the first report I’ve had of this. If disabling all the plugins doesn’t fix the problem, please send me an email.

  5. I’ve noticed that it won’t apply the custom ‘category-sticky’ class to the post if the post is assigned multiple categories. For example, I have it set to CategoryA and Featured (which displays the post on the homepage), and have it stickied in CategoryA. The stickiness works fine, but it doesn’t apply the ‘category-sticky’ class, so I can’t do any custom styling. If I remove the Featured category, it works, but then won’t display on my homepage. Any ideas?

      1. hi tom
        i seem to have the same problem as michelle. on the page mentioned above i classified the second post (“philosophische reisen”, the explanatory main post for this category, also categorized in this category) as a sticky post for the category “philosophische reisen” but it’s still listed chronologically because it’s also categorized in another category. i need this other category in order to exclude/hide the post from the regular posts listing on the front page. any solution?

      1. Sorry, I don’t understand your comment. Do you mean the class still exists after the plugin is de-activated or what? Let me know (and provide a link so I can take a look, as well).

    1. They shouldn’t be appearing on the homepage – this could be a problem with your theme or another plugin.

      I typically don’t offer free support, but if you’d like me to take a look at it and provide a resolution, then feel free to contact me and let’s see what we can do!

  6. Hi Tom,

    I’m having an issue. Whatever post I make sticky lays on top of the default “latest” post, so it’s like they’re fighting for the same spot.

    I’m sure it has something to do with a conflict with my theme, but can you lead me in the right direction so I have an idea of how to fix this?

    1. This sounds like a conflict with another plugin or your theme – this is the first I’ve heard of the issue.

      If you can email me the details of your environment, I’ll make a note. Also, just a heads up, since this is a free plugin, I’m only able to address issues as soon as I get a chance.

  7. Hello,
    I really like this plugin but I have a quick question for you. Do you think it is possible to increase the amount of sticky posts that I can display on a category from 1 post to 4 post? That would be amazing if you let me know what I have to do in order to do this.

    Thank you for this amazing plugin and I will wait for your reply.

        1. I’d look into the code where I’m modifying the loop to find the post that’s marked as sticky and then rather returning a single post, creating an array of posts to be stuck to the top and then putting them at the top (or the front) of the array of posts that are to be rendered.

          I hope this helps!

  8. Hi Tom,
    This plugin is just what I wanted for my About section, so thank you! But I can’t seem to get rid of the heavy black border at the top. I’ve tried overriding the CSS in my child theme but it’s not working. Of course I did check the box that says hide border. It doesn’t show up on the individual post, but does on the category page. Can you please help me? I’m not a code pro, obviously, just a lowly artist, so feel free to talk down to me! :-D
    Leah
    p.s. Here’s what I tried to do in my child theme:
    media=”all”
    .category-sticky {
    border-top: none;
    border-bottom: none;
    }

  9. Hi,
    I have a problem with that plugin. When it is activated I can’t edit menu structure. I only can add new item at the end of menu, and it’s not possible to move it anywhere. Links for moving does not work, drag and drop does not work either. I use WordPress 3.9.2

    1. Hey Majki,

      This sounds like it’s a problem with a conflict of something else thats running alongside the plugin. It could be something in the theme or it could be something in another plugin.

      Without knowing more, there’s not much I can do.

  10. Hi Tom,
    I have been using your sticky category widget for just over a year and it’s been great. However, I had a problem with the last set of revisions I made and two things happened (not sure if they’re related). First, the menus blew up (not your widget’s fault – that’s just the first symptom), so that a bunch disappeared and I’ve had to rebuild them. Second, most of the categories are grayed out from the list when I try to select them from the list to make a post category sticky.

    The list appears to be generating correctly, and the two new categories I created today area available, but most of the existing categories (including parents and subs) are not available. Any suggestions where to look? Many thanks.

  11. This works like a charm except for one thing — with sub or “child” categories, all the sticky posts associated with that category show up… in my case for a client site I have a “healthy foods” category with a variety of sub-categories like “healthy olive oil” “healthy dairy” etc. On the parent category “Healthy Foods” I get all the child category sticky posts. Am surprised not to see this question asked already — so maybe I’m missing something. Hope it’s an easy answer as this is a great plugin!

  12. Hi Tom

    congratulations for your plugin …

    I have two questions for you:

    I can only select one post as stickhy for each category?

    the post selected as stickhy is visible twice (at the top and at the original position) … you can see it only at the top?

    Thanks

    1. Thanks!

      I can only select one post as stickhy for each category?

      Yes. One sticky post per category

      the post selected as stickhy is visible twice (at the top and at the original position) … you can see it only at the top?

      Only at the top.

  13. Hi,

    Thanks for the plugin! I have a couple of questions, though.

    – On admin-side article listing it displays a ‘0’ after the title if the article is not set as a Category Sticky Post. This is a bit annoying…

    – I cannot get translations to work. I’ve made the translations using Poedit and placed the files in /lang under the plugin. Filename fi.po matches my language settings in config.php.

    Any ideas? Thanks.

    1. – On admin-side article listing it displays a ‘0’ after the title if the article is not set as a Category Sticky Post. This is a bit annoying…

      I hate to say it, but I’m not sure why this is happening. This is the first report that I’ve had with this particular issue.

      Do you also see it when you swap themes?

      – I cannot get translations to work. I’ve made the translations using Poedit and placed the files in /lang under the plugin. Filename fi.po matches my language settings in config.php

      IIRC, the format of the filename needs to be en_US.mo, for example. Try that format and let me know.

  14. Tom,

    I’m working on a site for a client and she is desperate to have the sticky post work on the home page. I’ve looked at the plugin code, and even tried to edit it, but it didn’t seem to do what I had hoped. Basically I just need the class to show up on any page, not just category pages. But specifically the home page.

    Any help you can provide would be greatly appreciated!

    1. Hey Glenn,

      Unfortunately, this is more in the realm of a customization for the plugin that’s not really possible for me to offer via blog comments. Remember that WordPress offers the native functionality to create a ‘Sticky Post’ for any post and have it stick to the homepage.

      IIRC, it even supports custom class names so that may be the better route to go.

      Hope this helps!

  15. Your app was working perfectly for me previously. I have had it installed for quite some time and about 2 months ago it seems to have stopped working.

    I have the category selected but it simply appears in the chronological position and not at the top (not sticky).

    My theme has not changed.

    Can you help?

  16. Tom McFarlin | You’re subscribed to discussion of Category Sticky Post For WordPressTom – What info can I provide you to look into it? Can I email it directly to you?

  17. Hi Tom,

    I’m looking for a plugin to get post to be sticky, but based on their post_type or category. Look like this Category Sticky is already close enough, but not quite 100% yet. Is there another one that you know suite my need?

    Thanks.

  18. Hi, your great plug has been working well for a long time, but since a few time there is a big problem: Post editor can not be opened, it go slowly to 520 error.

    My web site is running with WP 3.9.5 and have 3.600 categories. Do this high number of categories make a problem for your plugin? Thanks

    1. Have you tried disabling the plugin?

      There’s nothing in the plugin that should be causing that problem, but if you’re dealing with over 3k categories, I can’t promise than it’s not choking at some point. 

      If your installation works after disabling the plugin, let me know and I’ll look into seeing about making the plugin more performant.

  19. Hi, and thanks fot your quick answering;

    Yes, I disabled your plugin and all others, one by one, to localize the problem.

    Installation works after disabling category sticky post
    Installation does not work with only category sticky post activated

    Thanks

    1. Hey Shane,

      Sorry to hear that! Unfortunately, the problem could be attributed to any number of issues – the theme, another plugin, etc. – I’d recommend trying it with the default theme first and seeing if the problem persists. I’d also recommend trying it with deactivating plugins and then re-activating them one-by-one to see if the problem persists.

      I’m planning to work on this plugin soon (as time permits) so there will be an update coming sooner rather than later (at least that’s the plan!).

      Hope this helps!

  20. Hi Tom,

    Your plugins is exactly what I’m looking for but unfortunately I can only get it to work when I disable another plugin I rely on: Ultimate Category Excluder. Do you have any suggestions for them to peacefully coexist? ;-)

    Sjoerd

  21. Hi

    When using the plugin I have problems I hope you can help me with.

    The sticky post for a category is shown only in the first page. In the inner pages (using the pagination) I get different sticky post – which displays twice – On top and as the first one in the list. How can I set the category sticky post to display as the only sticky post?
    The excerpt that is not part of the post in inner pages. How do I add it to use the post text automatically?
    How do I change the sticky post from item to another so I won’t have a category without a sticky post when I disable the previous sticky post?

    Thanks

    Rani

    1. The sticky post for a category is shown only in the first page. In the inner pages (using the pagination) I get different sticky post – which displays twice – On top and as the first one in the list. How can I set the category sticky post to display as the only sticky post?

      This isn’t a problem that I’ve encountered before and it may be an issue with your theme or another plugin.

      I’d recommend reverting to the default theme and/or disabling other plugins to see if it fixes the problem. If not, let me know.

      How do I change the sticky post from item to another so I won’t have a category without a sticky post when I disable the previous sticky post?

      This is in the dashboard in a metabox on the right-hand side of the screen. You can opt to choose to make a given post the sticky post of a category and it’ll override whatever else is set.

  22. Hi

    I’m using Genesis.

    The code for the title is:

    add_action( ‘genesis_before’, ‘genesis_do_post_title’, 18 );

    add_action( ‘genesis_before’, ‘feature_excerpt’, 19 );

    I assumed it should be the same content in all the inner pages, but it changes for each page in the category.

    Any idea why?

    1. I assumed it should be the same content in all the inner pages, but it changes for each page in the category.

      I don’t use Genesis, but based on what you’re sharing, it looks like you’re trying to add a specific action for displaying the title and the feature excerpt for a given post.

      Other than that, I don’t really understand what you’re asking me.

  23. Sorry.

    The code is for the category.php

    I’m trying to display the featured sticky post on all category pages.

    I’m using inside the function:

    function feature_excerpt() {

    $length = 30;

    echo ‘

    ‘ . wp_trim_words( get_the_excerpt(), $length ) . ‘

    ‘;

    }
    I want to display the same sticky category post in every category page (1,2,3,4…)

  24. Hi Tom, thanks for your work.

    I’d like to remove all meta tags from the (category) sticky posts ONLY. Can it be done by modifying the code of your plugin? If yes, could you please help? I’m a css/php beginner.

    1. Heya,

      By meta tags, I’m guessing you mean the class attribute values on the HTML element. This isn’t something the plugin can do on its own as some of it is left up to the theme.

      Though it can be done, I don’t think this is something that I’d advise a beginner to attempt as it could lead to a completely broken theme if something is missed or improperly removed.

  25. Hi Tom, your awesome plugin is exactly what I needed for my site. I have a question. Is it possible that only admins be authorized to change the sticky posts? I cannot permit my subscribers, authors and editors to kick my sticky posts out from the top row…

    1. Is it possible that only admins be authorized to change the sticky posts? I cannot permit my subscribers, authors and editors to kick my sticky posts out from the top row…

      This isn’t possible without modifying the plugin – it would need to have some additional code written in order to support this.

    1. Is it possible to have multiple sticky posts per category?

      As the plugin stands right now, it’s not. Ultimately, that would defeat the purpose of having a sticky post. The functionality is built around the same idea as a standard WordPress Sticky Post where you can stick a single post to the top of a category archive page.

      If so, how would our developers make that change?

      This would depend on a number of different things:

      1. The UI would need to allow multiple posts to be selected
      2. The posts in the UI would need to be ordered
      3. The query on the archive page would need to retrieve those posts and place them at the top of the query
      4. The code would need to remove those posts from their standard place in the query.

      Hope this helps!

  26. dear. Tom

    help pls

    the problem is I have 150 categories

    drop down the “Category Sticky” appears only 72 categories (out of 150)

    this limitation? it can be corrected? please help

    1. This isn’t something that I can help with on my blog, unfortunately. It’d have to be done as a support request (which isn’t yet available for my free plugins).

      Keep an eye on the blog for when I begin to offer this type of service.

      Thanks Yury – I wish I could be more help.

    1. Unfortunately, this is likely to do with the theme.

      The best advice I can give is to try it out using Twentysixteen or one of the default themes on localhost and see if it works. If so, then it’s the theme; otherwise, it’s a bug in the plugin.

      I don’t really offer support for my free plugins, but I do currently have something in the works where there’s a big upgrade and an option for support for this particular plugin (and its companion plugin, Tag Sticky Post) coming sometime soon.

      So your timing is pretty spot on. Please follow-up with me here (or via email on my contact page) and we’ll go from there!

  27. Hi Tom!

    Thank you for you excellent job. Your plugin is very useful.

    However, I have a big necessity in sticking the post on the “CATEGORY TOP POSTS” which is on my mainpage and reflects all recently added posts. The latest post is on the top.

    I am ready cover the fees.

  28. Hi Tom,

    your plugin ist great, that’s what my theme needs. But I have a little problem, hope you will help me. :) I need to have the latest post after all the existing sticky post, not on the top of them. I tryed to configure your script to

    //loop over posts and relocate stickies to the front

    for( $i = $num_posts; $i>0; $i++){

    if( in_array( $posts[$i]->ID, $sticky_posts ) ){

    $sticky_post = $posts[$i];

    //remove sticky post from current position

    array_splice( $posts, $i, 1 );

    //move to front, after other stickies

    array_splice( $posts, $sticky_offset, 0, array( $sticky_post ) );

    //increment the sticky offset. the next sticky will be placed at this offset.

    $sticky_offset–;

    //remove post from sticky posts array

    $offset = array_search( $sticky_post->ID, $sticky_posts );

    unset( $sticky_posts[$offset] );

    }

    }

    but this doesn’t work, I’m afraid I’m not a programmer. For you it’s surely a litte thing.

    It would be gorgeous if you would help me! Please.

    Yours, Fritz

    1. Hey Fritz — thanks so much for this comment. Unfortunately, I don’t offer support for this plugin via comments on this blog. I have a plan to eventually re-write this particular plugin by next year but what you’re asking is something that I can’t really do outside of contract work via Pressware.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.