我认为最简单的方法就是使用WordPress已经生成的类别档案。将永久链接设置中的类别库更改为issues
所以你有很好的URL,然后在category template, 检查您是否正在查看顶级类别或子类别,并显示相应的标记:
$this_category = get_queried_object();
// if parent is 0, category is top level
if( 0 == $this_category->parent ) :
// top level category,
// show child categories of this issue
$args = array(
\'child_of\' => $this_category->term_id,
\'title_li\' => \'\',
\'hide_empty\' => 0
);
// output a list of child cats for this issue
// see also get_categories or get_terms if you wish to use your own markup
wp_list_categories( $args );
else :
// child category,
// show articles in this subcategory, etc.
echo \'child category\';
endif;