Skip Navigation

[Resolved] Filtering by Taxonomy / Unexpected Behaviour

This support ticket is created 9 years, 8 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 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 -
- - - - - - -

Supporter timezone: Europe/Madrid (GMT+01:00)

This topic contains 5 replies, has 2 voices.

Last updated by Wolf-Dieter 9 years, 8 months ago.

Assigned support staff: Caridad.



I'm trying to filter a view by taxonomy, with "Value set by the current page".

Both page and type have a taxonomy, which works fine as long both have a value assigned.
For example, I use the taxonomy with value "homepage" on the homepage and also in the record I want to show > only the items with "homepage" are shown, not items with different taxonomy values.

But apparently, having an empty taxonomy on the page leads to all items being shown there… which was certainly not the idea behind the filter.

Any suggestions?

Thanks! Wolf-Dieter


Dear Wolf-Dieter,

Can you show me a screenshot of your filter to avoid confusion?



I'd like to do the following:
> add a custom taxonomy to the pages of the site
> add a custom taxonomy to my custom post type "quotes"

Show only the quotes…
… that have a non-empty custom taxonomy
… that have a custom taxonomy value = custom taxonomy on the page with the embedded view
… only on pages with a non-empty custom taxonomy.

Currently it works correctly as long as the page has a taxonomy value set. If not, ALL quotes are being shown. Which is not what I intended…

lg! Wolf-Dieter


Dear Wolf,

I believe this should work, let me consult the developers and I will get back to you.



Dear Wolf-Dieter,

This is by design. It works similar to the way the front end filters work. eg. if nothing is selected it displays all results.

You can wrap the View in a wpv-if and check the post taxonomy and only display the view if there is some taxonomy. Something along the following lines:

[wpv-if evaluate="!empty('[wpv-post-taxonomy type="your_taxonomy_slug"]')"]
[wpv-view name="The name of your view"]

Let me know if you need help with this. Here is the documentation for shortcodes:

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.




Thank you! I get the point of the filtering behavior and it did the trick. As I'm using the shortcodes via do_shortcode in the sidebar, I ran into some troubles with the quotes/double quote but simply replaced the [wpv-if] with some php.