WordPress.org

Ready to get started?Download WordPress

Forums

Filtering posts by meta_query (1 post)

  1. ColoursB
    Member
    Posted 10 months ago #

    I've referenced http://codex.wordpress.org/Class_Reference/WP_Query, 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(
    											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?

Reply

You must log in to post.

About this Topic