WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Have problems to sort out right information using WP_Query together with Easy Content Types. My query looks like this

$query = new WP_Query( array( 'post_type' => 'buildarea',  'territory' => 'centrum' ));
while ($query->have_posts()) : 
    echo the_content();
// Restore original Post Data
wp_reset_postdata(); ?>

territory is a taxonomy and i want to sort out items belong to "centrum" and to the post-type "buildarea". I also have a post-type called "combuilding" using sam taxonomy. When I use the query i got result from both "combuilding" and "buildarea". What have I done wrong?

Results from var_dump($query->request);

FROM wp_posts 
INNER JOIN wp_term_relationships 
    ON (wp_posts.ID = wp_term_relationships.object_id) 
    WHERE 1=1 
    AND ( wp_term_relationships.term_taxonomy_id IN (11) ) 
    AND wp_posts.post_type IN ('combuild', 'residential', 'seniorh', 'avapartm', 'add-contact', 'buildarea', 'gen-inf', 'post', 'page') 
    AND (wp_posts.post_status = 'publish' OR wp_posts.post_author = 1 AND wp_posts.post_status = 'private') 
GROUP BY wp_posts.ID 
ORDER BY wp_posts.post_date DESC LIMIT 0, 10
share|improve this question
Please edit you question to include the output of var_dump($query->request);. Also, that {taxonomy} => {term} pattern is deprecated and has been for awhile. You should be using a meta_query. – s_ha_dum May 21 '13 at 13:48
Please use the WYSIWYG editor to format your content. Thanks. – kaiser May 21 '13 at 14:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.