我有一个自定义分类法(版本),并希望在URL结构中反映的分类法中有一个年/月层次结构。
/editions/2016/december
/editions/2017/december
/editions/2018/december
WordPress似乎不允许我在管理端创建这个。这可能吗?
以下是我在functions.php
:
/* Editions Function */
function aa_editions_tax() {
register_taxonomy( \'editions\', \'page\', array(
\'labels\' => array(
\'add_new_item\' => \'Add New Edition\',
\'all_items\' => \'All Editions\',
\'edit_item\' => \'Edit Edition\',
\'menu_name\' => \'Editions\',
\'name\' => \'Editions\',
\'new_item\' => \'New Edition\',
\'not_found\' => \'No Editions Found\',
\'not_found_in_trash\' => \'No Editions Found in Trash\',
\'parent\' => \'Parent of Edition\',
\'search_items\' => \'Search Editions\',
\'singular_name\' => \'Edition\',
\'view_item\' => \'View Edition\'
),
\'hierarchical\' => true,
\'public\' => true,
\'rewrite\' => array(
\'hierarchical\' => true
),
\'query_var\' => true,
\'show_ui\' => true
));
}
add_action( \'init\', \'aa_editions_tax\' );