Home › Forums › General Issues › Meta query for post object? › Reply To: Meta query for post object?
Hello all,
I’m doing a similar thing as above but finding it hard when my post_object has multiple objects.
OK here is what I am doing:
1. Custom post type with Courses in
2. Custom post type with Tutors in
3. On the Courses page there is a post object box where you select which tutors are deliverying the course.
4. On the front end, on the single tutors page, it will list the courses this tutor is delivering.
At the moment on the tutors page I have this:
<?php
$args = array(
'post_type' => 'cpt_courses',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'course_tutors',
'value' => '86',
'compare' => 'IN'
)
)
);
// query
$wp_query = new WP_Query( $args );
// loop
while( $wp_query->have_posts() )
{
$wp_query->the_post();
the_title();
// ...
}?>
Help help would be much appreciated, thanks
Josh
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.