我有一个名为doctor services的分类法注册,还有一个名为taxonomy doctor services的分类法模板。php,但当我单击分类法链接时,它不会显示分类法的详细信息。这是一个代码
function doctors_custom_post(){
$labels = array(
\'name\' => \'Doctors\',
\'singular_name\' => \'Doctor\',
\'add_new\' => \'Add Doctor\',
\'add_new_item\' => \'Add New Doctor\',
\'all_items\' => \'All Doctors\',
\'edit_item\' => \'Edit Item\',
\'new_item\' => \'New Item\',
\'view_item\' => \'View Item\',
\'search_items\' => \'Search Doctors\',
\'not_found\' => \'No record found\',
\'not_found_in_trash\' => \'No items found in trash\',
\'parent_item_colon\' => \'Parent Item\'
);
$args = array(
\'labels\' => $labels,
\'public\' => true,
\'publicly_queryable\' => true,
\'show_ui\' => true,
\'query_var\' => true,
\'rewrite\' => true,
\'capability_type\' => \'post\',
\'hierarchical\' => false,
\'supports\' => array(\'title\', \'editor\', \'excerpt\', \'thumbnail\', \'revisions\'),
//\'taxonomies\' => array(\'category\', \'post_tags\'),
\'menu_position\' => 15,
\'exclude_from_search\' => false
);
register_post_type(\'my-doctor\', $args);
}
add_action(\'init\', \'doctors_custom_post\');
add_action( \'init\', \'doctors_my_taxonomy\');
function doctors_my_taxonomy(){
// custom post type taxonomies
$labels = array(
\'name\' => \'Doctor Departments\',
\'singular_name\' => \'Doctor Department\',
\'add_new\' => \'Add Department\',
\'add_new_item\' => \'Add New Department\',
\'all_items\' => \'All Departments\',
\'edit_item\' => \'Edit Item\',
\'new_item\' => \'New Item\',
\'view_item\' => \'View Item\',
\'update_item\' => \'Update Department\',
\'search_items\' => \'Search Departments\',
\'not_found\' => \'No record found\',
\'not_found_in_trash\' => \'No items found in trash\',
\'parent_item_colon\' => \'Parent Item\',
\'menu_name\' => \'Departments\'
);
$args = array(
\'labels\' => $labels,
\'hierarchical\' => true,
\'has_archive\' => true,
\'rewrite\' => array(\'slug\' => \'doctor_departments\'),
\'show_ui\' => true,
\'show_admin_column\' => true,
\'query_var\' => true,
);
register_taxonomy(\'doctor-department\', array(\'my-doctor\'), $args);
$labels = array(
\'name\' => \'Diseases\',
\'singular_name\' => \'Diseases\',
\'add_new\' => \'Add Disease\',
\'add_new_item\' => \'Add New Disease\',
\'all_items\' => \'All Disease\',
\'edit_item\' => \'Edit Item\',
\'new_item\' => \'New Item\',
\'view_item\' => \'View Item\',
\'update_item\' => \'Update Disease\',
\'search_items\' => \'Search Disease\',
\'not_found\' => \'No record found\',
\'not_found_in_trash\' => \'No items found in trash\',
\'parent_item_colon\' => \'Parent Item\',
\'menu_name\' => \'Diseases\'
);
$args = array(
\'labels\' => $labels,
\'hierarchical\' => true,
\'has_archive\' => true,
\'rewrite\' => array(\'slug\' => \'doctor_diseases\'),
\'show_ui\' => true,
\'show_admin_column\' => true,
\'query_var\' => true,
);
register_taxonomy(\'doctor-diseases\', array(\'my-doctor\'), $args);
$labels = array(
\'name\' => \'Services\',
\'singular_name\' => \'Service\',
\'add_new\' => \'Add Service\',
\'add_new_item\' => \'Add New Service\',
\'all_items\' => \'All Services\',
\'edit_item\' => \'Edit Item\',
\'new_item\' => \'New Item\',
\'view_item\' => \'View Item\',
\'update_item\' => \'Update Service\',
\'search_items\' => \'Search Service\',
\'not_found\' => \'No record found\',
\'not_found_in_trash\' => \'No items found in trash\',
\'parent_item_colon\' => \'Parent Item\',
\'menu_name\' => \'Services\'
);
$args = array(
\'labels\' => $labels,
\'public\' => true,
\'publicly_queryable\' => true,
\'hierarchical\' => true,
\'has_archive\' => true,
\'rewrite\' => array(\'slug\' => \'doctor_services\'),
\'show_ui\' => true,
\'show_admin_column\' => true,
\'query_var\' => true,
);
register_taxonomy(\'doctor-services\', array(\'my-doctor\'), $args);
}
和分类服务页面
<?php
get_header(); ?>
<div id="primary">
<div id="content" class="content">
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-9 col-lg-9">
<h2> <?php
single_cat_title();
?>
</h2>
<?php category_description(); ?>
</div>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
和分类链接
http://example.com/doctor_services/xray/
请帮助错误在哪里