Problem:
I have to display different icons (png) in the template according to custom taxonomy (categories and subcategories).
Solution:
This is possible with a taxonomy view + a custom taxonomy image field, for example:
1) Create a taxonomy image field "my-icon"
2) Dashboard-> Toolset-> Views, Create a taxonomy view, for example "my-view"
- Query terms of your taxonomy "categories"
- Filter by:
Taxonomy is set by the current post
- In view's loop, display the custom image field "my-icon" shortcode
3) In single post content, display above taxonomy view shortcode, for example:
[wpv-view name="my-view"]
Relevant Documentation:
https://toolset.com/course-lesson/creating-custom-fields/