Skip Navigation

[Resolved] Exculde one category from search se;ect menu

This support ticket is created 6 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 4 voices.

Last updated by Jeff Coen 6 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#527721
Edit_View_‹_Dairy_King_—_WordPress_-_2017-05-23_16.23.17.png

I am trying to: Exclude one of my category taxonomies from a dropdown select menu

I visited this URL: hidden link

I expected to see: When I get to the Our Produce area, I select my drop down menu and I should not see the category 'Sponsors'.

Instead, I got: The category 'Sponsors' still appears.

#527793

Dear Jeff,

I assume the dropdown menu "Search by Category" is outputted from Views shortcode [wpv-control], please check the document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-control
There isn't such an option to exclude a specific term from the taxonomy filter, so there isn't such a built-in feature within Views plugin, if you agree, we can take it as a feature request, our developers will evaluate it.

#528241

Yes, it definitely needs to be a feature request! We don't that one link in the menu! It should not be seen!

#528280

I vote for this feature too! I need a couple of categories to be hidden and I would like to exclude them from parametric search. That would be a very usefull feature!!

#528289

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Luo is on vacation and this is Minesh here and I'll try to help you further and take care of this ticket. Hope this is OK.

Well - there is no native feature available to exclude a taxonomy term from taxonomy dropdown filter BUT I have a workaround to offer you.

You can use JQuery/javascript to remove the unwanted taxonomy term from your taxonomy select box. Please try to add following code to your view's Filter section JS box:

jQuery(document).ready(function($){
    
// list of all unwanted category options values as comma separated
var arr = ['sponsors'];
    
  $('.js-wpv-filter-trigger option').each(function() {
    if(jQuery.inArray($(this).val() , arr ) != '-1'){
          $(this).remove();
    }
      
});
});

I hope above solution will help you to resolve your issue.

#528633

Thanks. That script worked wonders.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.