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:

    $location = get_field(‘location’);
    echo '<pre>';
    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.