With use of the Advanced Custom Fields plugin I created a select dropdown which contains 6 membership types. All of my 'listings' using this custom field are assigned one of the 6.
I'd like to display all 'listings' by:
Ultimate Plus
Ultimate
Professional
Commercial
Business
Free
In this particular order, so those paying for the highest level membership have their 'listing' appear at the top of the page.
I expected it to be similar to this which I just found but unsure exactly:
// args
$args = array(
'post_type' => 'directory_listings',
'meta_key' => 'free',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => '#',
'value' => array( #, # ),
'compare' => 'IN',
),
),
);
// query
$wp_query = new WP_Query( $args );
?>
<?php if (have_posts()) : ?>
<?php
while( $wp_query->have_posts() ) {
the_post();
ldl_get_template_part('listing', 'compact');
ldl_get_featured_posts();
}
?>
<?php else : ?>
<?php endif; ?>