Problem: I have a taxonomy View and I would like to exclude one category.
Solution: You can accomplish it with custom code and the wpv_filter_taxonomy_query API:
//Exclude specific term from term View add_filter( 'wpv_filter_taxonomy_query', 'ts_modify_tax_query', 10, 3 ); function ts_modify_tax_query( $tax_query_settings, $view_settings, $view_id) { $views = array( 12345 ); if( in_array( $view_id, $views ) ) { $tax_query_settings['exclude'] = '67890'; } return $tax_query_settings; }
Replace 12345 with a comma-separated list of View IDs where you would like to exclude a specific term. Then replace 67890 with a comma-separated list of term IDs you would like to exclude. Place this code in a child theme's functions.php file, or in a new custom code snippet in Toolset > Settings > Custom Code.
Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_taxonomy_query
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.
Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
Dieses Thema enthält 4 Antworten, hat 2 Stimmen.
Zuletzt aktualisiert von vor 5 Jahren, 5 Monaten.
Assistiert von: Christian Cox.