当我从数据库中的头部导航栏中选择类别时http://www.taracomplementos.com/tara/, 默认显示的是数据库的所有项目,您必须选择页面中的一个类别才能查看相关文章。我希望我知道如何只显示属于特定类别的项目。我认为诀窍一定在以下几行,但我不知道如何修改它:
<div class="sort">
<ul id="portfolio-control">
<li class="segment-1"><!-- changed All for todo --><a class="active all" data-value="all" href="#"><?php _e(\'todo\', \'ux\') ?></a></li>
<?php wp_list_categories(array(\'title_li\' => \'\', \'exclude\' => $excludecat,\'taxonomy\' => \'skill-type\', \'walker\' => new Walker_Category_Filter())); ?>
</ul>
</div>
<?php endwhile; else : endif; ?>
</div>
<div class="span16 gallery">
<?php $args = array(
\'post_type\' => \'portfolio\',
\'orderby\'=>\'menu_order\',
\'order\' => \'ASC\',
\'posts_per_page\' => \'-1\',
\'skill-type\' => get_query_var(\'skill-type\'),
\'tax_query\' => array(
array(
\'taxonomy\' => \'skill-type\',
\'field\' => \'id\',
\'terms\' => $excludecat,
\'operator\' => \'NOT IN\',
)
) // end of tax_query
);
?>
<?php $query = new WP_Query($args); ?>
有人能帮我吗?TIA,guido