我用下面的代碼創建了一個自定義的側邊欄-wallside-sidebar.php。除了鏈接以外,一切都很完美。get_category_link()沒有顯示任何內容
<div id="wallpaper-categories" class="widget widget_categories">
<h4 class="widgettitle">Wallpaper Categories</h4>
<ul>
<?php
$args = array('type' => 'post' , 'taxonomy' => 'wallpaper' , 'order' => 'ASC' , 'orderby' => 'name');
$categories = get_categories($args);
foreach ($categories as $category) {
?>
<li class="cat-item cat-item-<?php echo $category->cat_ID; ?>">
<a title="<?php echo sprintf(__("View all posts in %s"), $category->name); ?>" href="<?php get_category_link($category->term_id); ?>"><?php echo $category->name; ?></a>
</li>
<?php
}
?>
</ul>
</div>
我也試過這種..但同樣的..沒有結果。 –
查看其他可能解決方案的更新答案。 – lanzz