These pages uses shortcodes: hidden link
Like this: [wpv-form-view name="holidays-sub-feat-pages" wpv-area="devon" wpv-collection="dog-friendly" target_id="self"]
[wpv-view name="holidays-sub-feat-pages" wpv-area="devon" wpv-collection="dog-friendly" view_display="layout"]
Is there a way of using these to use tow taxonomies in the same collection? Note the same wpv-collection code.
This works well when using taxonomies from two different collections like wpv-area and wpv-collection
Worth an ask 🙂
Hi Pete,
Thank you for waiting.
During testing on my website, I was able to make this work, by passing multiple taxonomy term slugs in a shortcode attribute, separated by commas.
For example:
[wpv-view name="holidays-sub-feat-pages" wpv-collection="just-fro-two, dog-friendly"]
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Hi Waqar<
Hmmm interesting. I did try all kinds of variations with commas and different things.
On this page: hidden link
I have used this code:
For the filter: [wpv-form-view name="holidays-sub-feat-pages" wpv-collection="close-to-coast, dog-friendly" target_id="self"]
For the grid: [wpv-view name="holidays-sub-feat-pages" wpv-collection="close-to-coast, dog-friendly" view_display="layout"]
Hate to say, it's bringing up results that are not 'close to coast'.
I'm unsure if your variation was one I tried initially however your code bringing things that are not in ;close to coast' collection.
Hi Pete,
If you'll check the "Collection" taxonomy's query filter in the view "Holidays Sub Feat Pages", you'll see that the "any of the values" option is selected.
( screenshot: hidden link )
This means that the view will get all the results, where either "close-to-coast" or "dog-friendly" terms are available.
If you'd like to get the results where all the passed terms should be available, the you'll need to change "any of the values" option to "all of the values".
regards,
Waqar
Hey Waqar,
You're a 'star', yep that sorted it...this works perfectly which I never thought it would 🙂
Can I ask, I duplicated the View in question, and on the replicated 'new' View made the adjustment to query filter.
If I had made this change to the existing View "Holidays Sub Feat Pages" would it have busted all the other Views set to the original settings?
Essentially, am I better having a separate View for this setup? 🙂 Thank you again 🙂
Hi Pete,
Thanks for the update and glad that this is sorted out.
Yes, if in all other pages, you need "any" of the terms comparison and only in specific page(s), you need "all" terms comparison, then duplicating the view is the right way to go. This way you'll have a view for each case.
regards,
Waqar
My issue is resolved now. Thank you!