Tell us what you are trying to do?
I want to create an unique view that queries all my post (so without filter but formatted)
I want to use this view for the blog page : that's OK
But I also need to display a selection of posts (filtered by taxonomy) in various pages of my site.
But in the pages, when I add the view in the text editor [wpv-view name="initiatives-in-indicator-pages"]
I don't have the posibility to filter my query to filter the post by taxonomy
I could create different filtered views but then I have to create more than 50 views...
Is there any documentation that you are following?
Is there any solution?
Sure, you can choose a filter using arguments in the View shortcode. On each page, you can place the View using a different shortcode argument to apply different taxonomy term filters. In your View, you must add a Query Filter that checks a shortcode attribute. If you cannot see the Query Filter section in your View editor, you can enable it in the Screen Options tab at the top of the screen. Here is an example:
[wpv-view name="initiatives-in-indicator-pages" wpvcategory="term-slug"]
This View would only show posts with the category term "term-slug". Screenshot attached. On another page you could use a different term:
[wpv-view name="initiatives-in-indicator-pages" wpvcategory="other-term-slug"]
Here's a page with more information about how this works:
Please let me know if you have additional questions about this.
Hi again Christian,
Sorry to come back but I still have an issue. I have added the parameter to the shortcode.
[wpv-view name="initiatives-in-indicator-pages" wpvcategory="diversity"]
It should display only 3 post with the taxonomy "diversity" (see screenshot)
But all the post are displayed instead. unfiltered. See post list at the bottom
I'm very sorry I just realized that I had the wrong setting selected in the screenshot I posted earlier. Instead of choosing "Set by one URL parameter" in the Filter Query, you should choose "Set by one View shortcode attribute". See the updated screenshot. If you chose URL parameter in the Filter Query options this could be the problem. If not, please take a screenshot showing the Filter Query settings so I can see what you have chosen.
Now it works!
Thank you very much Christian.