Opened 15 years ago
Closed 15 years ago
#10549 closed defect (bug) (wontfix)
Sticky not working with query_posts()
Reported by: | kingjeffrey | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.8.1 |
Component: | General | Keywords: | query_posts, sticky |
Focuses: | Cc: |
Description
Sticky posts do not always float to the top when using query_posts().
Things work as expected in this simple case:
query_posts('showposts=9');
But sticky posts cease to work as soon as you filter by category_name, like this:
query_posts('category_name=portfolio&showposts=9');
Change History (4)
#2
@
15 years ago
- Milestone Unassigned deleted
- Resolution set to worksforme
- Status changed from new to closed
You can exclude sticky posts being prepended via caller_get_posts = 1.
#3
@
15 years ago
- Resolution worksforme deleted
- Status changed from closed to reopened
@nacin
Thank you. I am aware of that, but it does not address my issue.
Sticky posts do not work with query_posts('category_name=portfolio&showposts=9');
(regardless of the caller_get_posts
setting.
Also, if sticky posts exist, query_posts('showposts=9');
does not return 9 posts (as would be reasonable to expect). It returns 9 non-sticky posts _plus_ all sticky posts
It appears that even
query_posts('showposts=9');
returns unexpected results. While sticky posts do rise to the top, the number of posts returned is 9 plus the sticky count.