2014-02-13 3 views
0

표시되지 :워드 프레스 사용자 정의 포스트 형식 범주의 명부는 내가라는 제품을 사용자 정의 포스트 유형을 설정 한

add_action('init', 'register_cpt_product'); 

function register_cpt_product() 
{ 
    $labels = array(
     'name' => _x('products', 'products'), 
     'singular_name' => _x('product', 'products'), 
     'add_new' => _x('Add New', 'products'), 
     'add_new_item' => _x('Add New product', 'products'), 
     'edit_item' => _x('Edit product', 'products'), 
     'new_item' => _x('New product', 'products'), 
     'view_item' => _x('View product', 'products'), 
     'search_items' => _x('Search products', 'products'), 
     'not_found' => _x('No products found', 'products'), 
     'not_found_in_trash' => _x('No products found in Trash', 'products'), 
     'parent_item_colon' => _x('Parent product:', 'products'), 
     'menu_name' => _x('products', 'products'), 
    ); 
    $args = array(
     'labels' => $labels, 
     'hierarchical' => false, 
     'supports' => array('title', 'editor', 'excerpt', 'thumbnail'), 
     'taxonomies' => array('category', 'post_tag'), 
     'public' => true, 
     'show_ui' => true, 
     'show_in_menu' => true, 
     'show_in_nav_menus' => true, 
     'publicly_queryable' => true, 
     'exclude_from_search' => false, 
     'has_archive' => true, 
     'query_var' => true, 
     'can_export' => true, 
     'rewrite' => true, 
     'capability_type' => 'post' 
    ); 

    register_post_type('products', $args); 
} 

제품은 my custom archive page와 함께 작동합니다. 그러나 범주와 함께; 나는 단지 "발견되지 않는다".

http://drysuits.dannycheeseman.me/category/lights/

나는 htaccess로 삭제하고 다시 저장 한 영구 링크 .. (/ % postname % /) 왜 이런 일이에 관해서는

어떤 아이디어?

답변

1

디스플레이 카테고리 사이드 바에 대한 맞춤 분류 분류 목록 플러그인에 사용합니다. 또는

당신은 the Codex article 코드 예제를 가지고 있지만,이 같은 일을해야, 사이드 바에서 목록을 만들 수 wp_list_categories 기능을 사용할 수 있습니다 : 귀하의 의견에 감사드립니다,

<ul> 
<?php wp_list_categories('taxonomy=products'); ?> 
</ul> 
+0

안녕하세요 .. 내가 이야기하고 해당 카테고리의 실제 제품에 대한 정보 .. http://drysuits.dannycheeseman.me/category/lights/ 나열된 제품이 있어야합니다 .. 없습니다 .. ?? –

+0

사이드 바 카테고리는 제품 분류 카테고리가 아닌 블로그 카테고리이므로 분류 분류 카테고리 및 분류 분류 상품 목록을 참조하십시오. –

+0

IT는 제품 기둥 형의 종류 .. –

관련 문제