Home Forums Bug Reports Doc bug or Google Maps API bug


Doc bug or Google Maps API bug

  • The instructions at this page in the documentation:

    mention two methods of registering the Google maps API.

    However, they don’t mention WHERE to put this php code.

    To get the custom post type displaying properly I created a child theme, with a styles.css and functions.php.

    I put both pieces of code (at different times) in the functions.php file that I created in my child theme.

    After a page refresh, the Google API checker in Chrome reports no API Key.

    Where I’m getting the error is editing the custom post time, i.e. URL of the form:


    The web server I have is running on “Localhost” but I haven’t locked down the Maps API, so the site shouldn’t matter.

    So either:
    1) both method 1 and 2 are bugged
    2) OR I didn’t put the code in the proper place.

    Regarding 2), the documentation should indicate a preferred location of the code to go in functions.php, meaning which functions.php

    So either way the docs need a slight change to indicate the preferred location of the two methods (neither method works). It might be nice if the pro/con of each method was mentioned too.

    I know the functions are running, as I put them in both .\wp-includes\functions.php as well as .\wp-content\themes\Divi-child\functions.php and promptly got a duplicate function error.

    Fatal error: Cannot redeclare my_acf_google_map_api() (previously declared in D:\Webroot\wordpress\wp-includes\functions.php:7407) in D:\Webroot\wordpress\wp-content\themes\Divi-child\functions.php on line 23

    Please note this isn’t the problem, it’s just evidence that both method 1 and method 2’s code IS being called (when in only one functions.php).

    Please help!

  • I tried to solve the error but in mine case both are bugged , so how could I solve them.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

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.