I am currently developing a site, I have three custom post types (speakers, events, videos). Each event has a relationship with speakers so when a event is created they select what speakers spoke at that event. my event page works fine and I can call the speakers fine. The problem I am having in my videos custom post type when creating a video the user has 2 relationships which they select which event it was recorded at and what speaker it is for. So on my events page under each speaker. I want it to get their video for that event. i have tried using meta query's but I cannot get it to work. I have posted on ACF forum with no reply. Any help would really be appreciated I have tried everything I can think of.
Above is the post on advanced custom field support forum.
Here is a paste bin of my events.php
Here is the section of code ,
<?php $posts = get_field('speakers'); if( $posts ) : foreach( $posts as $post) : setup_postdata($post); ?> <div class="span_6 speaker"> <div class="span_5"> <img src="<?php the_field('speakers_image'); ?>" /> </div> <div class="span_7"> <h3><?php the_title();?></h3> <?php $videos = get_posts( array( 'post_type' => 'videos', 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'speaker', 'value' => get_the_ID() ), array( 'key' => 'events', 'value' => $eventid ) ) ) ); $videoquerys = new WP_Query($videos); ?> <a class="" href="#">View Profile</a> </div> </div>
Above is what i have tried the information between event and speaker i can get fine its querying the speaker and event and getting the video that matches i am having trouble with.