Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type

The code you need will vary slightly depending on whether the Conference field is storing a text string (like “Big Ten”) vs. the ID of the Conference post. I’ll include both:

Text String Example

// place this code inside the loop of your single-team template
$conference_name = get_post_meta( get_the_id(), 'conference', true );
$conference = get_page_by_title( $conference_name, OBJECT, 'conference' );

if ($conference) {
    echo apply_filters( 'the_content', $conference->post_content );
}

ID Example

// place this code inside the loop of your single-team template
$conference_id = get_post_meta( get_the_id(), 'conference', true );
$conference = get_post( $conference_id );

if ($conference) {
    echo apply_filters( 'the_content', $conference->post_content );
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)