방금 WordPress 사이트의 다른 페이지에 '페이지 유형'을 추가하는 맞춤 분류를 만들었습니다. 페이지에 추가 할 수는 있지만 불행히도 이러한 분류를 CMS의 메뉴에 추가 할 수는 없습니다. 각 페이지는 '남성', '여성'또는 '정보'로 설정되므로 메뉴 항목으로 사용하는 것이 좋습니다. 아래에 코드를 제공했는데 도움이 될 것입니다. 감사!메뉴에 추가 할 때 맞춤법이 잘못되었습니다.
function add_custom_taxonomies() {
// Add new "Locations" taxonomy to Posts
register_taxonomy('Page-type', 'page', array(
// Hierarchical taxonomy (like categories)
'hierarchical' => true,
// This array of options controls the labels displayed in the WordPress Admin UI
'labels' => array(
'name' => _x('Page Types', 'taxonomy general name'),
'singular_name' => _x('Page Type', 'taxonomy singular name'),
'search_items' => __('Search page types'),
'all_items' => __('All page types'),
'parent_item' => __('Parent page type'),
'parent_item_colon' => __('Parent page type:'),
'edit_item' => __('Edit page type'),
'update_item' => __('Update page type'),
'add_new_item' => __('Add new page type'),
'new_item_name' => __('New page type Name'),
'menu_name' => __('Page Types'),
),
// Control the slugs used for this taxonomy
'rewrite' => array(
'slug' => 'page-types', // This controls the base slug that will display before each term
'with_front' => false, // Don't display the category base before "/locations/"
'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/"
),
));
}
add_action('init', 'add_custom_taxonomies', 0);
감사합니다! 이 부분을 살펴보고 필요한 부분을 업데이트하고 다시 방문하겠습니다! – Chuck