Support

Account

Home Forums General Issues Output Custom Fields Relational Post Object Field Reply To: Output Custom Fields Relational Post Object Field

  • If you are going to loop over the posts as in the code above then you do not need setup_postdata() because you’re using $featured_post->ID

    This is for getting a field for the post of the related post, not the current post.

    
    $custom_field = get_field( 'field_name', $featured_post->ID );
    

    To add text above of below you can just add it inside of the if block.