2016-11-18 3 views
0

나는이 글을 조금 잃어 버렸습니다.분류 및 맞춤 우편 유형 주문

99 %의 사용자 정의 분류 표를 만들기 위해 인덱스 페이지를 만들려고하지만 orderby를 무시하고 게시 된 날짜 순서로 게시물을 표시합니다.

$number_of_posts = intval(get_option('theme_number_posts_agent')); 
$get_county = get_terms( 
    'new_developments', 
    array(
     'orderby' => 'name', 
     'order'  => 'ASC', 
     'hide_empty' => 1, 
    ) 
); 

if(!$number_of_posts){ 
    $number_of_posts = 3; 
} 

foreach ($get_county as $get_countys) { 
    $agents_query = array(
     'post_type'  => 'agent', 
     'posts_per_page' => $number_of_posts, 
     'paged'   => $paged, 
     'orderby'  => 'title', 'order' => 'ASC', 
     'tax_query'  => array(
      array(
       'taxonomy' => 'new_developments', 
       'field' => 'slug', 
       'terms' => $get_countys 
      ) 
     ) 
    ); 

$agent_listing_query = new WP_Query($agents_query); 

if ($agent_listing_query->have_posts()) : 
    while ($agent_listing_query->have_posts()) : 
     $agent_listing_query->the_post(); 

내가

... get_terms에서와 wp_query 아무것도하지만 두 곳에서 ORDERBY 배치 한 어떤 도움을 크게

+0

당신이이 질문을 읽었다 감사합니다이 가장 대답이 플러그인을 사용할 수있는 것 같아요? http://wordpress.stackexchange.com/questions/14306/using-wp-query-is-it-possible-to-orderby-taxonomy – Benoti

+0

흠 괜찮아요, 조금 바보 같아요. 내가 그걸로 일하는 것이 완벽 할거야. – Aaron

답변

0

난 당신이 사용자 정의 분류를 주문하려는 생각 주시면 감사하겠습니다 .. (사용하지 않는) 6) 없음 없음 completamente의 implementado - 사본에서는 3) 이름 4) 슬러그 5) term_group를 계산하지 않음) 1) ID 2 분류 체계에 위해를 줄 수 있습니다. 그러나 날짜 옵션이 없습니다.

난 당신이 https://wordpress.org/plugins/taxonomy-terms-order/ 당신이