Hi There,
I've been following this thread ......
https://toolset.com/forums/topic/filter-view-by-date-greater-than-today-or-blank-but-already-using-and/
I need help with a couple of things before being able to implement it.
1. How do I define the ID's of the first two views
2. How do I display the 3rd view, is it a short code and if so how would be best to implement it?
Many thanks in advance
Hello and thank you for contacting the Toolset support.
I wonder if you are trying to build the same feature on that ticket or if you are just looking to combine AND and OR in a view filter? Please elaborate more on your use case, so I can give accurate advice.
In the meantime, I'll try to answer your questions:
1. How do I define the ID's of the first two views
You can use the get_view_query_results function to get the array of posts that the view will return. Then you can loop through them to get the IDs.
https://toolset.com/documentation/programmer-reference/views-api/#get_view_query_results
2. How do I display the 3rd view, is it a short code and if so how would be best to implement it?
You can display the view, either using a shortcode, or using the Toolset View block if you are in the blocks editor. The shortcode to display a view is wpv-view.
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-154377
Regarding the combination of AND and OR, you can also, hook into the view's query filter(wpv_filter_query) and modify it the way it suits you. Check the following links:
- https://wordpress.stackexchange.com/questions/139289/multiple-nested-tax-query-relation/310245#310245
- https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
I hope this helps. Let me know if you have any questions.