如何获取所有子类别 id ?分类和子分类就像
2013
April 10
April 9
April 8
March 10
March 9
2012
June 10
May 6
May 5
Cast
Group
Party
如何获得当月的所有子类别 ID?我需要这个来分页来显示像 site.com/catrgory/catrgory-slug/issue/{year}/{month}/{day} 这样的页面链接。我需要显示带有子类别页面链接的分页。其中列出了特定子类别的所有帖子。
我正在使用重写网址
add_action('generate_rewrite_rules', 'past_issue_rewrite_rules');
function past_issue_rewrite_rules( $wp_rewrite ) {
// handles paged/pagination requests
$new_rules = array('category/catrgory-slug/issue/(.+)/(.+)/(.+)/' => '?year='.$wp_rewrite->preg_index(1).'&month='.$wp_rewrite->preg_index(2).'&day='.$wp_rewrite->preg_index(3));
// Add the new rewrite rule into the top of the global rules array
$wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
}