Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#8855 closed defect (bug) (invalid)

order=ASC shows all posts

Reported by: scribu Owned by:
Milestone: Priority: normal
Severity: major Version: 2.7
Component: General Keywords: reporter-feedback
Focuses: Cc:


Doing query_posts('order=ASC') returns all posts, ignoring the other query vars (author, tag etc.)

Change History (3)

#1 @DD32
9 years ago

  • Keywords reporter-feedback added

If you're simply using "query_posts('order=ASC');" then yes, That returns all posts, query_posts() doesnt take into account current query vars, it completely rests it.

You could use something like:

query_posts( array_merge($GLOBALS['wp_query']->query_vars, array('order' => 'ASC')) );

to achieve what you're after i think

Has this changed from an earlier version of WP?

#2 @DD32
9 years ago

it completely rests it.

It completely resets the query i mean

#3 @ryan
9 years ago

  • Milestone 2.7.1 deleted
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.