I'm creating a form that loops through all the terms of a taxonomy. Multiple terms can be selected and they get passed in the url. I'm trying to get all the terms on another page but I'm only able to get the last one. I'm not sure if this is the best way to do this but if anyone can give me a tip as to what I'm doing wrong.
First, here is the form
<form method="get" id="searchProperties" action="<?php echo home_url()?>/filter-2/?">
<?php
$termsCounty = get_terms( 'County', array(
'hide_empty' => 0
) );
echo '<ul>';
foreach ($termsCounty as $term) {
$termCounty = $term->name . 'PropertyFilter';
echo '<li><label><input type="checkbox" name="t" value="il_' . $term->name . '">' .$term->name. '</label></li>';
}
echo '</ul>';
?><input type="submit" value="FILTER"/>
</form>
And here is where the choices are accessed:
echo $term = $_GET['t'];
Any suggestions? Thanks in advance!