Possible to filter custom post type with multiple meta data?

I’m wondering if it’s possible in one loop to accomplish what I need to do. What I would like is to sort all custom post types by the meta data of county and put them in order which it is doing here. But I would also like it to then sort by acres within that. So it would look like:

County 1 – acres 1, County 1 – acres 2, County 2 – acres 1, County 2 – acres 2 etc.

Read More

But I have a third meta data value that I would like to sort by also. So I would like it to behave this way but show the properties that are not sold first and then the ones that are sold second.

So it would look like:

County 1 – acres 1 – not sold, County 1 – acres 2 – not sold, County 2 – acres 1 – not sold, County 2 – acres 2 – not sold, County 1 – acres 1 – sold, County 1 – acres 2 – sold, County 2 – acres 1 – sold, County 2 – acres 2 – sold etc.

Is this possible?

Thanks in advance!

               <?php $args = array( 
                    'post_type' => 'property', 
                    'posts_per_page' => 100, 
                    'orderby' => 'meta_value', 
                    'meta_key' => 'county', 
                    'order' => 'ASC'
                    );


                    $loop = new WP_Query( $args );

Related posts