Opened 17 years ago
Closed 17 years ago
#10549 closed defect (bug) (wontfix)
Sticky not working with query_posts()
| Reported by: | kingjeffrey | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 2.8.1 |
| Severity: | normal | Keywords: | query_posts, sticky |
| Cc: | Focuses: |
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
@
17 years ago
- Milestone Unassigned
- Resolution → worksforme
- Status new → closed
You can exclude sticky posts being prepended via caller_get_posts = 1.
#3
@
17 years ago
- Resolution worksforme
- Status closed → 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
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.