2012-12-05 45 views
1

我想知道如何獲取子類別以在wordpress的側欄上顯示其父類別下的「子類別」?理想情況下,這將是一個樹狀的時尚。如何獲取子類別以樹形方式在wordpress中的側欄上顯示「其父類別下方」?

我很驚訝這不是標準。 HTML標記似乎甚至沒有任何可用的CSS類,我可以用它來區分類別的級別。這是我有:

<h3 class="widget-title">Categories</h3>   
<ul> 
    <li class="cat-item cat-item-3"><a href="http://localhost/sites/wordpress/?cat=3" title="View all posts filed under test parent">test parent</a> </li> 
    <li class="cat-item cat-item-4"><a href="http://localhost/sites/wordpress/?cat=4" title="View all posts filed under test sub 1">test sub 1</a> </li> 
    <li class="cat-item cat-item-1"><a href="http://localhost/sites/wordpress/?cat=1" title="View all posts filed under Uncategorized">Uncategorized</a> </li> 
</ul> 
+1

您是否在窗口小部件選項中選中了「顯示層次結構」? –

+0

這就是答案。你應該給你的評論一個答案,我會接受它... – pixelearth

+0

好吧,我已經添加了這個(很短)的答案。 –

回答

0

您需要檢查類別小部件的選項中的「顯示層次結構」。

相關問題