0
如何獲得所有的子類別ID? Catrgories和subcatrgories就像WordPress的過濾器分類
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}。我需要顯示與子類別頁面的鏈接分頁。 其中列出了特定子類別的所有帖子。
我現在用的是重寫URL
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;
}