Get specific post connections
-
On my functions.php I try to get specific post connections but I don’t get the connections and I’m not sure why. Any help?
So far my function is such:
function my_get_person_title( $post_id ) { $connections = new WP_Query( array( 'connected_type' => 'business_to_people' 'connected_items' => $post_id, // also tried here get_queried_object_id() 'suppress_filters' => false, 'nopaging' => true, ) ); if ( $connections->have_posts() ) : while ( $connections->have_posts() ) : $connections->the_post(); $title = get_post_meta( $post->ID, '_title', true ); // do something else with $title but title is empty endwhile; endif; return true; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get specific post connections’ is closed to new replies.