views:

28

answers:

1

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</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

+1  A: 
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);
Chacha102
Perfect, thanks! :)
Nimbuz