• Resolved namwebs

    (@namwebs)


    I have the same requirement as mentioned here: https://ww.wp.xz.cn/support/topic/remove-empty-terms/ i.e.  if you select one filter, and that causes some terms to no longer have items that match, it also shouldn’t be displayed. For example, if I have a category with terms “shirt” and “pants” and another with “red” and “blue”, if I select “pants” and there are no “red” pants, then “red” shouldn’t be displayed either.

    That thread is 9 months old and the response was “We will take your wishes into account in the future.” Am I correct that this has not yet been implemented? Is there a workaround?

    My use case is that I have a custom post type (resources), with three custom taxonomies (year, topic, type). I have a page with filters for all three taxonomies. Not all resource types have all topics, for example, so if I filter on one type (e.g. public doc) I would like the filter for topics to automatically reset to only show the relevant topics. This doesn’t happen at the moment.

    Any suggestions on how to achieve this?

    Thanks for the plugin – it is almost perfect!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author YMC

    (@wssoffice21)

    Try using these settings to display the terms in the filter bar

    https://prnt.sc/CJAA3j246yQC

    Thread Starter namwebs

    (@namwebs)

    Hi,

    Thanks but I already have the settings like that (on Selected terms).

    It’s a site under development so I can’t share the URL yet.

    • This reply was modified 1 year, 2 months ago by namwebs.
    Plugin Author YMC

    (@wssoffice21)

    At the moment, the filtering system provides management between different taxonomies taking into account their relations, as well as selected terms. You can use the default plugin settings or override them manually. To do this, use the corresponding hooks of the plugin (add_filter(‘ymc_filter_custom_extra_layout_FilterID’, ‘custom_extra_filter_layout’, 10, 6);), which will allow you to customize the filter according to your tasks. Here, you independently define the entire algorithm of the filter. This is a custom solution and it is not included in the default plugin settings (although for most tasks the basic settings are enough). For more detailed information, see the plugin documentation https://github.com/YMC-22/smart-filter.

    Thread Starter namwebs

    (@namwebs)

    Thank you, I will look into that.

    Plugin Author YMC

    (@wssoffice21)

    Good Luck!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Remove empty terms from filters’ is closed to new replies.