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?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We’re reaching out to our multilingual users to ask for help in translating ACF 6.1. Help make sure the latest features are available in your language here: https://t.co/TkEc2Exd6U
— Advanced Custom Fields (@wp_acf) May 22, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.