Home › Forums › Back End › Only Display posts with specific custom field value within string or array › Reply To: Only Display posts with specific custom field value within string or array
August 4, 2013 at 8:25 am
#145643
Esquivelia
Participant
Senff,
Thanks man! Working now!
<?php
$args = array( 'post_type' => 'ait-dir-item',
'meta_query' => array(
array(
'key' => 'location',
'value' => 'annapolis'
),
array(
'key' => 'item_tags',
'value' => 'Non-Marine',
'compare' => 'LIKE',
)
),
'orderby' => 'title',
'order' => 'ASC',
'posts_per_page' => 300 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
the_title('<h3 class="entry-title">', '</h3>');
echo '<div class="entry-content">';
the_content();
echo '</div>';
endwhile;
?>