Home Forums ACF PRO Post_object fields in vCard Reply To: Post_object fields in vCard

  • I’m sorry this was not a good description.

    I need the Address field(s).

    In each profile page, all the correctly rendering fields; Name, Company Name, Title, email and Phone number are pulled directly from personnel post type custom fields. However, The address fields are brought in from a post_object in a Custom Post Type of Locations. In the loop that looks like:

    <?php $field_name = "location";
    $field = get_field_object($field_name);
    echo $field['label']; ?>:</h5>
    	<?php $post_object = get_field('location'); 
    	if( $post_object ): 
    		// override $post
    		$post = $post_object;
    		setup_postdata( $post ); ?>
    		<p><?php the_field('street_address'); ?><br>
    		<?php the_field('suite_office'); ?><br>
    		<?php the_field('city'); ?>, <?php the_field('state'); ?><?php the_field('zip_code'); ?>

    I having trouble getting ; street_address, suite_office, city and state to render in the vCard.

    To be specific, I don’t know how to render the post object and related subfields into the vCard ‘echo’ statement. Does that make more sense?