WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can i retrive a post from a Post Type were "distributie_seriale" is a relationship field.


I add an Actor to PostType - actors ( Add post)


I add an Serial on PostType- serial ( Add post) I link the serial in Relathionship Field with the actor. After i do that i click Publish.

Results: On the Serial Page i retrive the actor, but the question is... How i retrive the serial on Actor Page.

Extra : The movies are in WP Post's The code down it retrive me the movies of post's Page.

How can i retrive a post's that is select, from a Post Type , in my case -- serial

$movies = $wpdb->get_col("SELECT post_id FROM $wpdb->wp_postmeta WHERE meta_key = 'distributie' AND meta_value LIKE '%".get_the_ID()."%'");
    $the_query = new WP_Query( array( 'post__in' => $movies) );
share|improve this question
possible duplicate of Getting movie and serial on actor page – s_ha_dum Feb 5 '13 at 22:22

I'm not sure that I completely understand your question, but if you're just looking for an array of movies that are of the type distributie, based on the ID of the current Loop object, this will do it:

$args = array( 
'post_type' => 'movies',
'meta_key' => 'distributie',
'meta_value' => get_the_ID()
$get_distributie_movies = get_posts( $args ); 

(not tested)

share|improve this answer
Christopher Ross thanks for responding, the solution did not work.. please look here.. excuse my duplicate posts...wordpress.stackexchange.com/questions/84426/… – Batman Feb 5 '13 at 22:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.