1
我可以看到已經有很多關於此的信息,但我似乎無法找到任何最新的信息,只是想知道是否有人可以幫助我。wordpress在父類別中顯示子類別
我有不同的父類別和子類別,例如:
虛擬主機
- 評論
- 券
域名註冊商
- 頂REGIST RARS
- 優惠碼
我使用的category.php頁面下面的代碼,並顯示子類在每個類別罰款:
<?php
if (is_category()) {
$this_category = get_category($cat);
if($this_category->category_parent):
else:
$this_category = wp_list_categories('orderby=id&depth=5&show_count=0&title_li=&use_desc_for_title=1&child_of='.$this_category->cat_ID."&echo=0");
echo '<ul>'. $this_category . '</ul>';
endif;
}
?>
但是當我點擊一個子 - 分類鏈接它顯示該子類別中的所有帖子罰款,但那麼顯然沒有回到父目錄等鏈接等。
有沒有反正做這個?有沒有人有我的代碼沒有任何錯誤?非常感謝。