Support

Account

Home Forums General Issues Trouble getting post object data to appear in front end Reply To: Trouble getting post object data to appear in front end

  • adlinks is the field label.

    <?php

    $post_object = get_field(‘post_object’);

    if( $post_object ):

    // override $post
    $post = $post_object;
    setup_postdata( $post );

    ?>
    <div>
    <h3>“><?php the_title(); ?></h3>
    <span>Post Object Custom Field: <?php the_field(‘adlinks’); ?></span>
    </div>
    <?php wp_reset_postdata(); // IMPORTANT – reset the $post object so the rest of the page works correctly ?>
    <?php endif; ?>