【发布时间】:2017-07-13 18:30:56
【问题描述】:
我正在尝试在我的 wordpress 主题中创建自定义分类页面模板,但它始终显示 archive.php 尽管我创建了 taxonomy-lesson_categories.php 并且也尝试过taxonomy-lesson-category.php 但不是那种工作。
这是我在functions.php中的分类函数:
function cv_themes_taxonomy() {
register_taxonomy(
'lesson_categories', //The name of the taxonomy.
'cv', //post type name
array(
'hierarchical' => true,
'label' => 'Lesson Category', //Display name
'query_var' => true,
'rewrite' => array(
'slug' => 'lesson-category',
'with_front' => true
)
)
);
}
add_action( 'init', 'cv_themes_taxonomy');
注意:我的 post_type 名称是 CV
有人知道原因吗?
【问题讨论】:
标签: php wordpress custom-post-type taxonomy custom-taxonomy