WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

does anybody know how to filter post by meta_key1 (meta_key1=something) and order by meta_key2 at the same time ?

query_posts('post_type=press_articles&posts_per_page=5&meta_key=dt_featured_press_radio&meta_value=yes&order=ASC') how add order by meta_key2 here ? thanks!

share|improve this question

WP_Query supports multiple values for the orderby argument (see the example from that link on the Codex.

I don't know if query_posts() does as well, but I suspect the pre_get_posts filter does, in which case you can replace query_posts() with that (which is the new "best practice" anyway).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.