So guys here is my code to query custom fields AND taxonomies:
1st I made some changes to the qmt-template “checkboxes.html” and “dropdowns.html” (as I use checkboxes and dropdowns for my form)
checkboxes:
<form method="get" action="{{base-url}}" class="custom taxonomy-drilldown-checkboxes">
{{#taxonomy}}
<div id="terms-{{taxonomy}}">
<ul>
{{{term-list}}}
</ul>
</div>
{{/taxonomy}}
dropdowns:
<form method="get" action="{{base-url}}" class="taxonomy-drilldown-dropdowns">
<ul>
{{#taxonomy}}
<li>
<select id="qmt-{{name}}" name="{{name}}">
<option value=''>{{{any-text}}}</option>
{{{term-list}}}
</select>
</li>
{{/taxonomy}}
</ul>
As I’m going to extend the forms with custom fields, I’lll close it later.
Now in my wordpress theme template ( in my case : archive.php) I built this extended form Just change the field names and keys etc that it fits your needs:
<!-- Query Multiple Taxonomies AS CHECKBOX -->
<?php
the_widget('Taxonomy_Drill_Down_Widget', array(
'title' => '',
'mode' => 'dropdowns',
'taxonomies' => array( 'tax1, tax2') // list of taxonomy names
));
?>
<!-- Query Multiple Taxonomies AS DROPDOWN -->
<?php
the_widget('Taxonomy_Drill_Down_Widget', array(
'title' => '',
'mode' => 'checkboxes',
'taxonomies' => array( 'tax3, tax4') // list of taxonomy names
));
?>
<!-- Now we combine the form with custom fields -->
<?php $custom_fields = get_meta_values( 'cf_key', 'cf_value' ); // Get all Meta Values associated with Key ?>
<!-- Get CF Min Value -->
<select name="album_rating_min" id="rating_min">
<option value="">-</option>
<?php foreach($ratings as $rating){
echo '<option value="' . $rating . '"' . ($rating == $_GET["album_rating_min"] ? ' selected="selected"' : '') . '>' . $rating . '</option>'; //Echo all Rating Values as Options
} ?>
</select>
<!-- Get CF Max Value -->
<select name="album_rating_max" id="rating_max"> <!-- Get Rating Max Value -->
<?php foreach($ratings as $rating){
echo '<option value="' . $rating . '"' . ($rating == $_GET["album_rating_max"] ? ' selected="selected"' : '') . '>' . $rating . '</option>'; //Echo all Rating Values as Options
} ?>
</select>
<!-- Let's submit our combined form -->
<input type="submit" value="filter" />
<!-- Close the form started in the qmt-templates -->
</form>