I can display posts from featured category like so:
query_posts('tag=featured');
... but is it possible to further sort it using a dropdown/select menu:
<select name="">
<option value="reviews">Reviews</option>
<option value="articles">Articles<开发者_Python百科;/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?
Thanks
query_posts('tag=featured,reviews');
So something like (you need to sanitize this)
$tags = array('featured', $_POST['selectbox']);
$query_posts_string = 'tag=' . join(',', $tags);
query_posts($query_posts_string);
精彩评论