我注册了2种分类法:festival_year
和art_genre
. 我希望用户搜索特定年份和流派,但不确定最好的方法。我尝试了各种插件,但都没有成功。我可以创建单独的文件,比如taxonomy-art_genre-consumable-crafts.php
使用以下代码:
<?php
$festivalquery = wp_parse_args($query_string);
$festivalquery[\'tax_query\'] = array(
\'showposts\' => 10 ,
\'orderby\' => \'title\',
\'order\' => \'ASC\',
\'paged\' => $paged,
\'relation\' => \'AND\',
array(
\'taxonomy\' => \'festival_year\',
\'terms\' => array(\'2010-artists\'),
\'field\' => \'slug\',
),
array(
\'taxonomy\' => \'art_genre\',
\'terms\' => array(\'consumable-crafts\'),
\'field\' => \'slug\',
),
);
query_posts($festivalquery);
?>
这给了我一个我正在寻找的问题。然而,共有11种类型(当然会有多年的时间)。与其创建单独的页面模板,实现这一点的最佳方法是什么?
试验地点:http://www.beta.cornhillartsfestival.com/artists/
非常感谢你!