You could use a javascript redirect to for passing the appropriate query_params. Checkout WP’s default widgets file for the categories dropdown widget. When you select a new category, it automatically refreshes the page and redirects you to the archive for that category. I used this same trick (or code for that matter!) to change the query_posts for sorting using GDStar’s query params.
Try this:
<a href="#" id='sort_by_rate_private' value>Sort by Rate per Private Session</a>
<a href="#" id='sort_by_rate_group'>Sort by Rate per Group</a>
<script type="text/javascript">
jQuery('#sort_by_rate_private').click(function(){
location.href = "<?php echo home_url(); ?>/?sortby=rate_per_private_session";
}
jQuery('sort_by_rate_group').click(function(){
location.href = "<?php echo home_url(); ?>/?sortby=rate_per_group";
}
</script>
Now get the $_POST[‘sortby’] value, and check it as follows:
<?php
if(isset($_POST['sortby'] && $_POST['sortby']=='rate_per_private_session')
{
query_posts($query_string . '&meta_key=rate_per_private_session');
}
else if(isset($_POST['sortby'] && $_POST['sortby']=='rate_per_group')
{
query_posts($query_string . '&meta_key=rate_per_group');
}
else
{
//nothing is set, hence default
//whatever
}
?>
Just make sure your url is right. Also check the jQuery(I have written as far as I could remember). Try this and let me know!
Thanks,
Rutwick