Problem:
Use Views plugin to query posts, with a taxonomy filter, the only problem with this approach is an issue I thought I had solved a long time ago but apparently wishful thinking and that problem is that this solution is also not taking the hierarchy into consideration.
Solution:
Views plugin is using WordPress class WP_Query to query posts, by default, the taxonomy filter will include child terms for hierarchical taxonomies.
In your case, you can try with Views filter hook "wpv_filter_query" to change the parameter "include_children" to false, for example this thread:
https://toolset.com/forums/topic/display-posts-for-parent-taxonomy-without-children-2/#post-228939
Relevant Documentation:
https://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters
include_children (boolean) - Whether or not to include children for hierarchical taxonomies. Defaults to true
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.
This topic is split from https://toolset.com/forums/topic/the-views-are-not-doing-exactly-what-i-want-them-to-do/
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9: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/Hong_Kong (GMT+08:00)
This topic contains 3 replies, has 2 voices.
Last updated by 5 years, 9 months ago.
Assisted by: Luo Yang.