Forums › Forums › Search & Filter Pro › Hide Empty Terms Not Working
Tagged: hide terms, hide_empty, taxonomy
- This topic has 6 replies, 3 voices, and was last updated 8 years, 8 months ago by Anonymous.
-
Anonymous(Private) March 29, 2016 at 2:23 pm #40841
Hi,
I am trying to use the ‘hide empty terms’ option when adding a filter for a custom taxonomy.
The filter is not correctly hiding the terms if they have no results against them.
If you navigate to this link (
https://www.bathcollege.ac.uk/course-search/?_sft_course_type=part-time-love2learn) you will see that in the dropdown for ‘Subject’, ‘Access to HE’ appears even though it has no results when chosen.I can see that ‘hide empty terms’ is set as when I print the $args variable on line 252 of taxonomy.php I get the following…
Array ( [sf_name] => _sft_course_type [sfid] => 734 [taxonomy] => course_type [hierarchical] => [child_of] => 0 [echo] => [hide_if_empty] => [hide_empty] => 1 [show_option_none] => [show_count] => [show_option_all] => [show_option_all_sf] => All [show_default_option_sf] => [show_count_format_sf] => html [elem_attr] => [include] => [title_li] => [defaults] => ) 111111Array ( [sf_name] => _sft_course_subject [sfid] => 734 [taxonomy] => course_subject [hierarchical] => 1 [child_of] => 0 [echo] => [hide_if_empty] => [hide_empty] => 1 [show_option_none] => [show_count] => 1 [show_option_all] => [show_option_all_sf] => All [show_default_option_sf] => [show_count_format_sf] => html [elem_attr] => [include] => [title_li] => [defaults] => )
I can see from this, that ‘hide_if_empty’ is not set, but I don’t think changing this helps, and I can’t see where it would be controlled in the plugin options.
Do you have any idea what could be causing these terms to show?
Thanks for your help!
Matt
Ross Moderator(Private) March 29, 2016 at 3:32 pm #40846Hi Matt
Did you try enabling “auto count” in the “general” tab?
This should accurately reflect the count numbers in the current query, and therefor hide empty options.
Thanks
Anonymous(Private) March 29, 2016 at 4:04 pm #40852Hi Ross,
Thanks for the quick reply.
I’ve enabled the ‘auto count’ setting, and this has updated those counts, and shows some in the list as ‘0’ now, but still doesn’t hide them. I’ve set up the count on this link to show you what I mean… https://www.bathcollege.ac.uk/courses-part-time-love2learn/
Thanks
Matt
-
AuthorPosts