Support » Plugin: Posts 2 Posts » [Plugin: Posts 2 Posts] relationship query
4 years, 4 months ago
I’ve got two objects, events and sessions.
an event can have multiple sessions.
I’d like to get all the events within a date range of today upto 14 days from today.
The date range is a meta_key startDate / endDate in session.
how am I best to retrieve the events?
should I query all the sessions for the date range and then take all the IDs and query the events for relationship IDs?
or can I get all the events and then when setting the relationship to the sessions can i add in a meta_query to filter out only sessions within the range? then only show events with sessions?
how would i write the code for that?
thanks in advance.