Thanks for response.
Now, I’m trying to show the number of results when a search is realized. I have searched across 9-sec support forum but haven’t seen any related topic. Furthermore, I want to print applied filters. I saw one code in a topic and I’m using print_r($getdata['taxo'])
.
Working together, when a search is realized, it would print something like this:
“Search results of example category and example tag : 18”.
Another question that I have is : how to show a category dropdown filter with hierarquical categorys? I use this snippet found in a topic:
add_filter('uwpqsf_tax_field_dropdown','custom_dropdown_output','',12);
function custom_dropdown_output($html,$type,$exc,$hide,$taxname,$taxlabel,$taxall,$opt,$c,$defaultclass,$formid,$divclass){
$args = array('hide_empty'=>$hide,'exclude'=>$eid );
$taxoargs = apply_filters('uwpqsf_taxonomy_arg',$args,$taxname,$formid);
$terms = get_terms($taxname,$taxoargs); $count = count($terms);
if($type == 'dropdown'){
$html = '<div class="'.$defaultclass.' '.$divclass.' tax-select-'.$c.'"><span class="taxolabel-'.$c.'">'.$taxlabel.'</span>';
$html .= '<input type="hidden" name="taxo['.$c.'][name]" value="'.$taxname.'">';
$html .= '<input type="hidden" name="taxo['.$c.'][opt]" value="'.$opt.'">';
$html .= '<select id="tdp-'.$c.'" name="taxo['.$c.'][term]">';
if(!empty($taxall)){
$html .= '<option selected value="uwpqsftaxoall">'.$taxall.'</option>';
}
if ( $count > 0 ){
foreach ( $terms as $term ) {
$selected = $terms[0]->term_id;
$html .= '<option value="'.$term->slug.'">'.$term->name.'</option>';
$args = array(
'hide_empty' => false,
'hierarchical' => true,
'parent' => $term->term_id
);
$childterms = get_terms($taxname, $args);
foreach ( $childterms as $childterm ) {
$selected = $childterms[0]->term_id;
$html .= "<option value='".$childterm->slug."'"."> ?? >" . $childterm->name . '</option>';
}}
}
$html .= '</select>';
$html .= '</div>';
return apply_filters( 'custom_dropdown_output', $html,$type,$exc,$hide,$taxname,$taxlabel,$taxall,$opt,$c,$defaultclass,$formid,$divclass);
}
}
but only shows 1 category depth. I have more categories inside subcategories. I tried with depth argument in $args but don’t work. How can I do it?
Thanks in advance.