I want to loop through posts and show only those posts for which the custom field
i.e _shop
is not empty
I am always confused with meta query and even not sure that if this is possible using this or not . Following is what i have tried so far
$args = array('post_type' => 'jobs',
'posts_per_page' => 12,
'paged'=> $paged,
'tax_query' => array(
array(
'taxonomy' => 'job_category',
'field' => 'slug',
'terms' => $term->slug,
),
),
'meta_query' => array(
array(
'key' => '_shop',
'value' => '',
'compare' => '!='
)
)
'meta_key' => '_shop',
);
$loop = new WP_Query( $args );