Full width home advertisement

Post Page Advertisement [Top]

acf google mapacf plugingoogle mapsgoogle maps apiissuemapspluginWordPress

Google Map not showing in WordPress backend - ACF plugin

Google Map not showing in WordPress backend - ACF plugin

Hello Developers, Hope you are doing well. I am a developer so day by day in every way, I am facing new issues and solved issues in any way. So today I came with the new issue faced at the time of developing WordPress backend with ACF plugin.

In WordPress, there are bunches of plugins that do wonderful works yet now and then we got some issue while working. One of them most established an issue in WordPress is ACF plugins google maps not showing WordPress backend.

How to get Google Maps API key?

Step 1: First of all you need to get the google maps API key, you can get your google maps API key from following steps.
  • Go to https://console.developers.google.com/
  • Under Google Map's API's choose Google Maps JavaScript API.
  • Enable the API.
  • Go to the credentials section and choose to create credentials.
  • Choose the API key from the popup, and then choose the browser key from the proceeding popup.
  • Enter your different page link in which google map is used including WordPress back-end page links.
  • Copy the API key and paste it into the following code.

I get the key by performing above steps you can follow different steps from this link https://console.developers.google.com/


ADDITIONAL READING ON KRAZZYCODES
  1. ERROR: Cookies are blocked or not supported by your browser
  2. How to add sub menu in Shopify?
  3. How to show single item into the owl carousel slider?
  4. "Sorry, your session has expired. Return to homepage" - WordPress WooCommerce error
  5. How to resize google reCaptcha?


Step 2: Add following code in your function.php file.

If you are using free ACF plugin add following code in your function.php file. Replace your google maps API key with "xxx".



       if(is_admin()):
          function my_acf_google_map_api($api){
             $api['key'] = 'xxx';
             return $api;
          }
          add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');
       endif;

     


If you are using  ACF pro plugin, then add following code in your function.php file


        if(is_admin()):
          function my_acf_init() {
             acf_update_setting('google_api_key', 'xxx');
          }
          add_action('acf/init', 'my_acf_init');
        endif;

     

The best solution for ACF Pro plugin:

Notes: Most important things that you have to keep in mind for the best solution for the above issue. If you are using ACF pro plugin then you must enter ACF pro plugin activation key. After inserting the key in plugin check your backend your issue is solved. 

For more details, you can visit this link: https://www.advancedcustomfields.com/resources/google-map/


If you still facing issues, then let me know via comment.
Don't be too selfish please do like, comment or share it.
Thank you for reading this post.

No comments:

Post a Comment

Bottom Ad [Post Page]