Opened 10 years ago
Closed 10 years ago
#25815 closed defect (bug) (invalid)
Sticky Posts don't work with category__in query
Reported by: | thezuberat | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | major | Version: | |
Component: | Query | Keywords: | stickies |
Focuses: | Cc: |
Description (last modified by )
If the category__in
argument is used for the query (query_posts()
, etc.) the sticky posts do not work anymore. See:
- http://wordpress.org/support/topic/category_in-ampamp-sticky or
- http://wordpress.stackexchange.com/questions/87472/ensuring-sticky-posts-are-retrieved-first-without-using-two-queries or
- http://wordpress.org/support/topic/sticky-posts-do-not-work-with-category_in-possible-solution
This is imo a major issue because you can't create category specific queries which support sticky posts atm.
Change History (4)
Note: See
TracTickets for help on using
tickets.
Any
tax_query
-like thing negatesis_home()
, which is never true whenis_archive()
is true, which is true becauseis_category()
is true. Your best bet is to display sticky-by-category posts in your template using a subquery:new WP_Query( array( 'post__in' => get_option( 'sticky_posts' ), 'category__in => .... )