Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

bradical911 on "Alphabetical ordering with Query Posts and 2 Meta Keys"

$
0
0

I have a query for custom posts and I have managed to order the results alphabetically based on the title first then ordered by the meta key "Species". This works great.

<?php $posts = query_posts($query_string . '&meta_key=Species&orderby=title+meta_value&order=ASC'); ?>

The problem is that is would like to also order by a 2nd meta key called "Variety" so in my mind the query might look something like this but it doesn't work.

<?php $posts = query_posts($query_string . '&meta_key1=Species&&meta_key=Variety&orderby=title+meta_value1+meta_value2&order=ASC'); ?>

Please help my client is giving me shit!


Viewing all articles
Browse latest Browse all 8245

Trending Articles