Support

Account

Home Forums Front-end Issues Display parent\'s relationship on child post Reply To: Display parent\'s relationship on child post

  • I have a feeling that I am not completely understanding how the relationships between your post types and posts work.

    But I think I’ve worked out what you want to do

    
    function my_post_object_query($args, $field, $post_id) {
    	$parent = wp_get_post_parent_id($post_id);
    	$meta_query = array(
    		array(
    		'key' => 'pro_to_con',
    		'value' => $parent,
    		'compare' => 'LIKE'
    	)
    );
    	$args['meta_query'] = $meta_query;
    		return $args;
    }