Practical WordPress Development

Category Sticky Post For WordPress 2.0 Now Available

Just a little over a year ago, I released my WordPress Category Sticky Post plugin. The initial concept was simple:

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.

And not a lot has changed since the first release.

Yes, I’ve made minor improvements here and there as evidenced by the changelog, but today I’m happy to officially release the second version of the plugin.

WordPress Category Sticky Post

Category Sticky Post

The category sticky post homepage.

One of the things that I’ve enjoyed the most about working on this particular project is its niche purpose. To that end, each time that a bug is fixed or something small is tweaked, it’s coming from actual users.

And in 2.0, I’ve introduced a couple of new features – some more focused on the code, others more focused on the end user – that I’m happy to finally have released:

  • Resolving a bug that marked the category as ‘unstuck’ when updating a post
  • Introduced a feature for disabling the category sticky border
  • Improving the coding standards of the plugin be separating the class into its own file
  • Improving the PHPDoc of the plugin

Perhaps the most visible new feature is the ability to actually disable the styling of the posts that are stuck within a category:

Category Sticky Post - Hide Border

The new option to hide the border on the category sticky post.

As usual, you can grab a copy of the file from the project homepage in the WordPress plugin repository.

Finally, keep the emails, questions, and comments coming and I’ll continue to work on improving the plugin even more.

21 Comments

  1. Joan

    Nice plugin, Tom! I’ll use it on some sites to promote some popular posts.

  2. juicy99

    Since upgrading to WordPress 3.8 Category Sticky Post caused the drop-downs in Edit Menus to stop working. Since disabling the plugin it works again. I love the plugin and wonder if you have any suggestions.

    • Tom McFarlin

      Thanks for the heads up – I’ll take a look and, if there is a bug, will issue a fix as soon as possible!

    • Tom McFarlin

      Heya – I’m unable to reproduce this error. Can you give me some clearer recreation steps so that I can try to reproduce the issue?

  3. Adam W. Warner

    Hey Tom, just looking at this plugin for use in one of our projects. I know you’re laser-focused on specific functionality for your plugins, but wondering if you have any plans to allow multiple posts per category to be marked as sticky?

    Our usage would be to designate a few “featured” posts per category archive instead of just one.

    • Tom McFarlin

      This timing of this comment is eerie – just yesterday, I received an email asking about the exact same feature.

      It’s not something I’ve previously considered, but given the fact that it’s something people clearly want, I’m going to see about introducing this functionality.

      Thanks for mentioning this – helps to make decisions around new features :)

      • Adam W. Warner

        My pleasure to add to your todo list:)

        Just testing this plugin after commenting and noticed something. There is some text that says “Post Border?”, but no check box is seen.

        Also see a checkbox for “Hide Sticky” and am not quite sure what the intent of this is. I’ve checked it and don’t see a difference in display.

        While I’m here, I might as well add to the wishlist…

        1. Assign a post to be sticky to multiple categories.
        2. A visual listing per category of all posts currently marked as sticky for any given category (or categories).

        I was just going through our dev site and had these two desires immediately.

        A boy can dream:)

  4. Adam W. Warner

    UGH, sorry, just saw this that answers my #2 above:
    http://wordpress.org/plugins/category-sticky-post/screenshots/

  5. Niclas Fagerholm

    Hi!
    I would also like to see the functionality for several sticky posts per category. It would help a lot! The use case for only one sticky post is to have a general post i guess with information/links towards other posts. But for me, I will have a few posts are just more important, so these should be visible right away.

    Also, being able to have the sticky post also sticky in other categories would be great (in my case the direct parent-category).

    Thanks!
    Nic

  6. Lucho Delboy

    On WP 4.0 I can´t select categories. Only the default one appears

    • Tom

      Hey Lucho,

      Thanks for the heads up – I’ll take a look as soon as I get a chance. If I’m able to reproduce it a vanilla installation of WP4.0 without any other plugins, then I’ll see if there’s a patch I can provide.

      Thanks again.

  7. Luis Miro

    Hey Tom,
    Great plugin first and foremost. Using it for some big things. One thing I was wondering was about the ability to select multiple posts for 1 category as well as the ability to select 1 post for multiple categories. For Example: Post 1 for Category A and B. or Post 1 and 2 for Category A.

    By doing this it allows for a lot of flexibility with the sticky posts especially if they can serve multiple purposes. I’d love to be able to do this as quickly as possible please let me know if this can be implemented soon!

    Thanks,
    Luis

    • Tom

      Hey Luis,

      Right now, there’s no way to select multiple posts for a given category.

      I’ll consider it, but this isn’t something that I can commit to implementing anytime soon since it’s a free plugin.

      Thank you for the idea!

  8. mgiulio

    Hey Tom,

    there’s a post(https://wordpress.org/support/topic/conflict-with-sticky-categories) on the support forum of my plugin https://wordpress.org/plugins/mg-quotes/ where the user reported a conflict with Category Sticky Post. I’had a look at your code and found the cause, a missing check for the main wp query. Here’s a quick patch:

    // Filters for displaying the sticky category posts
    L80: add_filter( ‘the_posts’, array( $this, ‘reorder_category_posts’ ), 10, 2 );

    L266: public function reorder_category_posts( $posts, $query ) {
    L270: if( $query->is_main_query() && is_archive() && 0 == get_query_var( ‘paged’ ) && ” != get_query_var( ‘cat’ ) ) {

    Cheers
    Giulio

    • Tom

      Thanks for the heads up! I’ll have this patched as soon as possible :).

  9. Binh WPOS

    Hi again Tom,

    I just realised that you are the author of this plugin. So the question should’ve been somewhat like “if it’s possible to set a sticky post based on their post_type”?

    Thanks.

    • Tom

      Yep – if you look at the changelog for the previous versions, you’ll see that this feature has been available since 2.1.0.

  10. Pete

    Hi Tom

    Great plugin – just seeing if you managed to get multiple working per category, or if anyone out there has…

    • Tom

      just seeing if you managed to get multiple working per category, or if anyone out there has…

      Others may have, but I don’t have plans to introduce this functionality.

Leave a Reply

© 2020 Tom McFarlin

Theme by Anders NorenUp ↑