I can successfully query post results using query posts like so...
<?php
// The Query
query_posts("gdsr_sort=rating");
// The Loop
while ( have_posts() ) : the_post();
?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php
endwhile;
// Reset Query
wp_reset_query();
?>
I was wondering if it's possible to make a dropdown menu where users can select different queries. So an example would a dropdown menu that says "Select Query" by deafult then when you click the dropdown menu it gives you different options like "Query 1", "Query 2", Query 3".. and when you click on one it loads the correct query for whatever query is set to number 1, 2, or 3.
I've done a lot of research and haven't found too much help regarding this issue. I don't know if I should set up an if / else
statement connect that to the <select>
input and then.. I don't know where to go from there.. or if that is even a proper way of doing it.
So, how would I make a dropdown menu that successfully loads different post queries? Any help would truly be appreciated. :)
add_query_arg()
for adding query parameters from your select field andget_query_var()
for retrieving/using them. – Chip Bennett Jan 15 '13 at 14:24