预先感谢您的帮助。我在一个在下拉菜单中显示标签并允许用户转到显示匹配帖子的网址的网站上工作。我在尝试在输出中显示两个可能的类别时遇到了麻烦。现在,结果仅显示“成功案例”,而我也试图包括“功能成功案例”的结果。这是我的逻辑代码:
$args = array(
'smallest' => 1, 'largest' => 1000, 'unit' => 'pt', 'number' => 999,'cat' => array(246,252),
'format' => 'array', 'orderby' => 'name', 'order' => 'ASC',
'orderby' => 'name',
'exclude' => '', 'include' => '5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,28,29,31,32,211,212,229,213,48,53,47,34,35,110,36,37,56,38,54,39,41,40,42,43,44,45,46,49,89,137'); $tags = get_tags($args);
这是下拉列表:
<form action="<?php bloginfo('url'); ?>" method="get">
<select id="select-of-tags" name="tag" onchange="if(this.selectedIndex){location.href=(this.options[selectedIndex].value)}">
<option value="">Choose an industry</option>
<?php foreach ($tags as $tag) {?>
<option value="<?php bloginfo('url'); ?>/index.php/category/success-stories/?tag=<?php echo $tag->slug ?>"><?php echo $tag->name ?></option>
<?php } ?>
</select>
</form>