Support » Fixing WordPress » Filtering posts by meta_query

  • I’ve referenced, but my query isn’t actually filtering the posts based off of the meta value. Right now I’m using

    $args = array(
    										'post_type' => 'property',
    										'meta_query' => array(
    												'key' => 'rental_type',
    												'value' => 'Long-Term'
    										'posts_per_page' => $properties_per_page,
    										'paged' => $paged
    							$query = new WP_Query( $args );

    … trying to filter out properties that are long-term rentals (as opposed to vacation rentals). The page is still displaying all of the properties, am I missing something?

  • The topic ‘Filtering posts by meta_query’ is closed to new replies.