I’m struggling to get google maps working. I’ve set the field up in the field group. And entered a lat/long location on the edit page section. I see the map in the admin area.
I’m 99% sure I’ve got the google api (with key) and the jquery-based js file loaded correctly. I’ve entered some console.logs in the script just to see where the script is running.
I think I’ve isolated the problem to the $location variable returning NULL after var_dumping it into a pre element. What’s a bit strange is the first time I did it, it returned an empty string. I then changed the field name to something totally unique, and it then changed to returning NULL.
The $location is set to be = to get_field(‘field_name’) as usual. I’ve also placed a simple text field on the same page, which works just fine.
If there is an empty string then usually that means that the post was saved with the acf field but no value was entered. So if the field name is correct then there must be some other reason why it’s not returning a value.
Where is the field group located? post, options page, somewhere else?
Where is the code for getting the field? Inside “The Loop” or outside?
Have you tried disabling other plugins or switching themes? There has been a rash of topics started lately about the divi theme and it’s data/time script breaking ACF.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users