Ticket #10549 (closed defect (bug): wontfix)
Sticky not working with query_posts()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 2.8.1 |
| Severity: | normal | Keywords: | query_posts, sticky |
| 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
comment:1
kingjeffrey — 3 years ago
- Status changed from new to closed
- Resolution set to worksforme
- Milestone Unassigned deleted
You can exclude sticky posts being prepended via caller_get_posts = 1.
comment:3
kingjeffrey — 23 months ago
- Status changed from closed to reopened
- Resolution worksforme deleted
@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.