0
我使用這個代碼來生成在WordPress的二類名單: WordPress的 - 取消空類別鏈接
<h2>Headline 1</h2>
<article class="post" id="post-<?php the_ID(); ?>">
<ul class="columns">
<?php echo wp_list_categories('title_li=&hide_empty=0&exclude=1,54,55'); ?>
</ul>
</article>
<h2>Headline 2</h2>
<article class="post" id="post-<?php the_ID(); ?>">
<ul class="columns">
<?php echo wp_list_categories('title_li=&hide_empty=0&include=54,55'); ?>
</ul>
</article>
反正是有斷開鏈接尚未有任何職位類別?我仍然希望它們在列表中可見,但不作爲鏈接。
謝謝!
恩,你能詳細說一下你的意思嗎?我不明白你的意思。 –
而不是17您可以傳遞類別ID,它會檢查該類別是否有帖子。如果該類別的帖子超過0,則只有它會打印該帖子的鏈接。 –