2013-06-25 2 views
0

'잡스'라는 사용자 정의 게시 유형이 있습니다. 맞춤 게시 유형에는 '위치'라는 맞춤 분류가 있습니다.get_the_term_list는 하나의 용어 만 가져옵니다.

작업 페이지에서 작업 게시가 해당하는 위치를 표시합니다. 한 가지 직무는 상해와 베이징에서 직책을 맡을 수 있습니다.

는 다음과 내가 쓰는이를 표시하려고합니다 ->

<?php 
    echo '<ul class="opp_location">'; 
    echo get_the_term_list($post->ID, 'locations', '<li>', ',</li><li>', '</li>'); 
    echo '</ul>'; 
?> 

그러나 작업 만이 한 학기, 아무것도 출력을 게시합니다.

그러나 두 개의 용어가있는 경우 두 번째 용어가 출력됩니다.

세 가지 용어가있는 경우 두 번째 용어 만 출력됩니다.

나는 여기서 무슨 일이 일어나고 있는지 잘 모르겠습니다. 이 게시물에 속한 맞춤 분류학의 모든 용어가 표시되도록하려면 어떻게해야합니까?

여기 functions.php에서 분류 코드의 ->

add_action('init', 'register_taxonomy_locations'); 

function register_taxonomy_locations() { 

    $labels = array( 
     'name' => _x('Locations', 'locations'), 
     'singular_name' => _x('Location', 'locations'), 
     'search_items' => _x('Search Locations', 'locations'), 
     'popular_items' => _x('Popular Locations', 'locations'), 
     'all_items' => _x('All Locations', 'locations'), 
     'parent_item' => _x('Parent Location', 'locations'), 
     'parent_item_colon' => _x('Parent Location:', 'locations'), 
     'edit_item' => _x('Edit Location', 'locations'), 
     'update_item' => _x('Update Location', 'locations'), 
     'add_new_item' => _x('Add New Location', 'locations'), 
     'new_item_name' => _x('New Location', 'locations'), 
     'separate_items_with_commas' => _x('Separate locations with commas', 'locations'), 
     'add_or_remove_items' => _x('Add or remove locations', 'locations'), 
     'choose_from_most_used' => _x('Choose from the most used locations', 'locations'), 
     'menu_name' => _x('Locations', 'locations'), 
    ); 

    $args = array( 
     'labels' => $labels, 
     'public' => true, 
     'show_in_nav_menus' => true, 
     'show_ui' => true, 
     'show_tagcloud' => true, 
     'show_admin_column' => true, 
     'hierarchical' => true, 

     'rewrite' => true, 
     'query_var' => true 
    ); 

    register_taxonomy('locations', array('job'), $args); 
} 

답변

0

OHP, 그것은 인식되지 않은 분류에서 처음으로 2 개 학기처럼 보인다. 나는 그들을 다시 추가하려고 노력했고, 그것을 고쳤다.

관련 문제