Home › Forums › Front-end Issues › Google Maps shows only string › Reply To: Google Maps shows only string
Hi @Blacksunice
In the future, please don’t dump huge block of code like you have. This doesn’t help solve the issue and a simple “I have used the exact code from the above tutorial” would have been suffice.
Firstly, have you debuged the PHP code to confirm that the data is loading correctly?
You can debug like so:
<?php
$location = get_field(‘location’);
echo '<pre>';
print_r($location);
echo '</pre>';
die; ?>
What data do you get?
Also, can you confirm that your field name is called ‘location’? Or have you left this the same as the documentation?
Also, what do you mean, “you have brought it outside the loop”? Please remember that ACF loads data from a post. Similar to the_title / the_content, the acf functions such as get_field need to be used WITHIN the post loop.
Thanks
E
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 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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.