我已经创建了一个自定义分类法,并试图让Wordpress在没有定义术语时显示分类法模板。目前Wordpress仅在URL上定义术语时显示模板。
我的分类法叫做projects
定义如下:
$args = array(
\'labels\' => array(
\'name\' => "Categories",
\'singular_name\' => "Category",
\'search_items\' => "Search Categories",
\'popular_items\' => "Popular Categories",
\'all_items\' => "All Categories",
\'parent_item\' => "Parent Category",
\'parent_item_colon\' => "Parent Category:",
\'edit_item\' => "Edit Category",
\'update_item\' => "Update Category",
\'add_new_item\' => "Add New Category",
\'new_item_name\' => "New Category Name",
),
\'hierarchical\' => TRUE,
\'label\' => \'Categories\',
\'query_var\' => TRUE,
\'rewrite\' => array(
\'slug\' => \'projects\'
),
);
register_taxonomy(\'projects\', \'project\', $args);
接下来,我创建了一个名为
taxonomy-projects.php
.
当前当我浏览到http://mysite.com/projects
URL,Wordpress返回到index.php
. 我怎样才能在没有定义术语的情况下,Wordpress显示我的taxonomy-projects.php
样板
UPDATE:
我应该马上添加这个,每次我更改重试时都会清除重写规则。