Wordpress - post 2 post search through relation

So I have a WordPress site with events. I have an event post type and an eventdate post type. events have many eventdates connected to them. What I want to do is a WP_Query on the events but I want it to find events that have eventdates connected between a certain time. the eventdates each have a unix time stamp on them.

    $args = array(         'post_type' => 'eventdate',         'orderby' => 'meta_value',         'order' => 'ASC',         'meta_key' => 'unix',         'meta_query' => [[             'key' => 'unix',             'value' => array('1469919600', '147259800'),             'compare' => 'BETWEEN',             'type' => 'NUMERIC'     ]],         'posts_per_page' => -1,     ); 

above is the query i use on the eventdate post type to get all the event dates between a certain time. I want to mix this with an event query based on tax

$args = array(         'orderby' => 'menu_order date',         'post_type' => 'event',         'meta_key' => 'show_in_grid',         'meta_value' => '1',         'posts_per_page' => -1,         'tax_query' => [             [                 'taxonomy' => 'arts_catergories',                 'field' => 'slug',                 'terms' => [                     'daily-films'                  ]             ]         ]     ); 

I get the dates connected to an event using the below

  $args = array(         'connected_type' => 'dates-to-event',         'connected_items' => $event,         'nopaging' => true,     ); 

I'm not sure if its possible but I'm wondering if there was anyway to mix all this together to return just the events matching the query that has eventdates in the given time range.


Category: wp query Time: 2016-07-29 Views: 0
Tags: wp query

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.310 (s). 12 q(s)