How to sort listing by two fields?
-
I’m currently listing all my posts from my custom_post_type by a meta_key value called ‘city’ as shown below:
<?php $catListings = new WP_Query( array( 'post_type' => 'directory', 'post_parent' => $post->ID, 'posts_per_page' => 500, 'paged' => $paged, 'order' => ASC, 'orderby'=> 'meta_key=city') ); ?>
The problem is that there are a lot of posts with the same city. So, I need to have it sort them by name, after sorting them by city. Does anyone know how I can do this?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to sort listing by two fields?’ is closed to new replies.