2014-04-18 3 views
0

나는 portfolio-categories이라는 사용자 지정 분류를 만들고 내 게시물 쿼리에서 제외시킬 범주를 만들었습니다. 게시물 쿼리에 추가했지만 게시물은 계속 표시됩니다.쿼리 게시물을 사용하여 사용자 지정 분류 제외

query_posts(array(
    'post_type'=> 'portfolio', 
    'orderby'=>'menu_order', 
    'order'=>'ASC', 
    'tax_query' => array(
     'taxonomy' => 'portfolio-categories', 
     'terms' => 7, 
     'field' => 'id', 
     'operator' => 'NOT IN' 
    ) 
)); 

사람이 여기에 문제를 발견 할 수 : 여기

는 내가 사용한 코드? 문서에서 이것은 나에게 맞는 것 같습니다. 이 같은

답변

0

사용 new WP_query()

$args=array('post_type' => 'portfolio', 
      'taxonomy' => 'product-category', 
      'orderby'  => 'menu_order', 
      'order'  => 'ASC', 
      'post_status' => 'publish', 
      'cat'   => 7 
); 
$query = new WP_query($args); 
while($query->have_posts()) : $query->the_post(); 

    ...... 

endwhile; 
0

시도 :

$args=array(
      'post_type' => 'portfolio', 
      'taxonomy'=>'product-category', 
      'orderby'=>'menu_order', 
      'order'=>'ASC', 
      'term' => 'usluge-proizvodi', 
      'post__not_in' => array(330,341), 
      'post_status' => 'publish', 
      'posts_per_page' => 8 
    ); 
관련 문제