1

我可以像这样显示特色类别的帖子:

query_posts('tag=featured');

...但是是否可以使用下拉/选择菜单对其进行进一步排序:

<select name="">
  <option value="reviews">Reviews</option>
  <option value="articles">Articles</option>
  <option value="interviews">Interviews</option>
</select>

... so when one of the option is selected, how do I modify the original query (which would be now: query_posts('tag=featured+option');) posted above to show the matching posts?

谢谢

4

1 回答 1

1
query_posts('tag=featured,reviews');

所以像(你需要清理这个)

$tags = array('featured', $_POST['selectbox']);
$query_posts_string = 'tag=' . join(',', $tags);
query_posts($query_posts_string);
于 2010-01-25T14:06:23.050 回答