Hi Nigel,
on this site I have created two hierarchical taxonomies:
1. Languages: Here the only field is the term description field.
2. Countries: Here there are two fields, one for the term description and an image field (the flag of the country)
Then I have created several custom post types. Some of these individual custom posts have assigned only one language and only one country, while other custom posts have one language assigned but more than one country.
This website is using Divi (already updated to the latest version 4.0.7)
Now, using the Divi theme builder, I am building a template for each Country taxonomy entry. I am using shortcodes from Views. In each taxonomy I want to add:
The term name for each country
The term description for each country
The image (flag) for each country
All the custom posts where the country is selected as a category.
Everything is fine when only a language and a country is assigned to one custom post. For instance, all posts related to the country Albania have one country and one language assigned:
hidden link
THE PROBLEM comes when several custom posts have assigned one language and several countries. Then in the taxonomy for a given country, for example, Belgium, the content is duplicated with other countries that are also included in those customs posts. For example in the taxonomy entry for Belgium:
hidden link
it also displays the term for Holland, the description for Holland, the flag for Holland etc.
I tried all combinations but I cannot limit the output. I appreciate your help on this.
Let me know if you have any question. I will give you access to the site.
Thanks!
Hello,
I can log into your website, please provide more details for the problem.
Where and how do you build a template for each Country taxonomy entry?please point out the URLs for the template
How do you setup the view's shortcode? [wpv-view ...]
Thanks
Hi,
the template is built with the Divi Theme Builder, where I edit the Custom body. See screenshot attached. The link is:
hidden link
As you can see I am using Views shortcodes.
For example, see screenshot about how I created the view "Bandera de pais" to show an image. That image is a field in the "Pais" category:
hidden link
I hope that helps.
Thanks!
Daniel
Thanks for the details, here are what I found.
The problem URL is archive page of taxonomy "País", there three views in the template you mentioned above, I have done below modifications in your website:
1) taxonomy view "Bandera de pais"
hidden link
in section "Query Filter", change the filter to:
Taxonomy term ID is set by the shortcode attribute "terms"
Edit edit the Custom body, change view's shortcode to:
hidden link
{!{wpv-view name='bandera-de-pais' terms='{!{wpv-taxonomy-archive info="id"}!}'}!}
Use shortcode {!{wpv-taxonomy-archive info="id"}!} to get the term's ID of current taxonomy archive, then pass it to above taxonomy view.
More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-taxonomy-archive
2) post view "Idioma(s) en País"
hidden link
Change the filter to:
Select posts with taxonomy:
Países the same as the current archive page
More help:
https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/
Use this setting when you’re adding this Views inside a term archive page and you want it to inherent the taxonomy filtering from the archive term.
3) post view "All posts with a certain country"
hidden link
Same as above, change the filter to:
Select posts with taxonomy:
Países the same as the current archive page
4) Edit edit the Custom body:
hidden link
in the left column, you can display the current term's name with shortcode:
{!{wpv-taxonomy-archive info="name"}!}
current term's description
{!{wpv-taxonomy-archive info="description"}!}
See the same document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-taxonomy-archive
I just tested it in your website, it works fine.
Great. Thanks a lot. I'll check it out now