Hi,
In a custom post type, I’ve assigned a ACF field group which includes a “Google Map” type element.
Using the Dynamic Content {{dc:post:meta key="address_location"}}
I get an output array which displays "Display Name, Lat, Long, Place ID, Address #, Address Street, Address Street Short Name, City, State/Province, Zip/Postal Code, Country, Country Short Name
Is there a way to identify what the keys for each element in that array is? Is it possible to break the array up so that I can format the output?
Hello @thomasgeorge,
Thanks for writing in! You can use the Looper Provider Array and then use {{dc:post:meta key="address_location"}}
dynamic content so that you can display each of the field. Perhaps, this documentation can help you out:
- https://theme.co/docs/loopers#array
- https://theme.co/docs/acf-pro-and-loopers#multi-dimensional-fields
Kindly let us know how it goes.
Hi,
Thank you! That helps a lot… I also use CPT UI… How can I refer to ACF fields in a custom post type, that is referred throughout the site (not just on the post page?)
In this particular case, I have a CPT of “Locations” that has various ACF Pro fields such as a “Google Map” entry. I would like to extract the various strings from the Google Map array in a “BOOK NOW” global button used across the site. Would you be able to offer further suggestions?
I use ACF and Loopers on other sites, but haven’t run into this post type specifically before.
Hello @thomasgeorge,
It is best that you provide us your WP details so that we can inspect how you have added the Google Maps ACF field to your custom post type. If you could also point out to which page or layout you are trying to display the Google Map location fields, that would also help. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site
To know how to create a secure note, please check this out: How The Forum Works
Best Regards.
Here you go!
I’ve figured this one out…
For (my) reference:
Here’s the looper provider/consumer tree as it goes:
Provider: Query Type: Location (CPT)
Consumer
Provider: Dynamic Content - {{dc:acf:post_field field=“location_address”}}; Consumed right away
{{dc:looper:field key=“address, etc”}} < I believe this is the one key component that was missed.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.