• Resolved Adrian Verstuyft

    (@adrian-verstuyft)


    Hi, great plugin, which I could easily adapt to all my special needs.
    BUT on each individual category page it shows all chosen sticky posts from all categories (before listing the normal ones).
    How can I filter/select only the appropriate sticky posts?

    Excluding other categories by using negative category IDs like “category_id=”-123″ didn’t work.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    Unfortunately this is how sticky posts in WordPress core works, and we’re leveraging the standard WordPress query (WP_Query) to generate our listings.

    You can disable sticky posts using:

    
    [display-posts ignore_sticky_posts="true"]
    

    WordPress doesn’t have a method of filtering the sticky posts to only those in the current category. It stores a list of all sticky posts and prepends that to the start of all queries.

    Thread Starter Adrian Verstuyft

    (@adrian-verstuyft)

    Wow, thanks for your quick answer.
    Is there a way of altering the “standard” query to get the desired result?

    Plugin Author Bill Erickson

    (@billerickson)

    I’d recommend avoiding sticky posts and implement this in another way, like with post meta. You could add a “Featured” checkbox when editing a post, then modify the main WP query to sort by featured then post date, instead of just post date.

    Plugin Author Bill Erickson

    (@billerickson)

    I haven’t tried it, but you might try NS Featured Posts. It adds the checkboxes to the WP administration area and then you can query for it in Display Posts with:

    [display-posts category=”my-category” meta_key=”_is_ns_featured_post” meta_value=”yes”]

    Thread Starter Adrian Verstuyft

    (@adrian-verstuyft)

    Thank you, I will try it and report back.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Category site shouldn’t show ALL sticky posts (also from other categories)’ is closed to new replies.