好的,现在我有一个页面,显示分类法(事件主题)中的类别列表,下面是代码:
<div id="themeSearch">
<h1 class="mainSectionHeader">By Theme</h1>
<ul id="themeSelector" class="jcarousel jcarousel-skin-tango">
<?php
//list custom portfolio categories
$taxonomy = \'event-themes\'; // define portfolio categories from taxonomies in functions.php
$tax_terms = get_terms($taxonomy);
foreach ($tax_terms as $tax_term) {
echo \'<li class="themeItem"><p><span>\' . $tax_term->name.\'</span></p><a href="index.php?<?php get_the_category( $id ) ?>" rel="\' . $tax_term->slug . \'"><span>Go</span></a>\';
}
?>
</ul>
</div>
首先,我知道echo\'d链接不起作用,这就是我需要帮助的地方。
我试图不仅显示所有类别,而且还希望每个类别link to a page displaying the posts within that particular category.
我想这段代码就快完成了,因为我想做的是insert the category ID within the href so that for each listed category it directs to the correct page.
非常感谢