admin管理员组

文章数量:1323348

Closed. This question is off-topic. It is not currently accepting answers.

Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?

Closed 4 years ago.

Improve this question

Recently, a client contacted me to make a few modifications on their website. Now consider that I'm not the person who made this website. It was supposed to be easy ; add a few lines here and there, change the contact information, update the address shown on the google maps and voilà !

But unfortunately, things didn't go so well for that last part. When you go on their website, in the contact page you see this google maps and a pin on it with the address attached. I thought "it's probably inserted either via a plugin or manually on the page". Turns out it's neither ! I cannot find a single trace of google maps on this website's configuration. Same on the page, there is nothing that indicates that a google maps was inserted, and I really need to change this address, but quite frankly I don't know how to.

(This might be a bit of stupid question, I'm still a student at the moment and I haven't done Wordpress in a looong while.)

I don't really know what I can share to make answering this question easier, because of the client's privacy. One thing I can do for sure though is let you know which plugins are already installed (maybe it's in one of them and I missed it ?) :

  • Akismet Anti-Spam
  • All in One SEO Pack
  • BackWPup
  • Contact Form 7
  • Custom Login Page Customizer
  • Event Espresso
  • Event Espresso - Grid View Template
  • Fancy Gallery
  • Flamingo
  • iframe
  • iThemes Security
  • MimeTypes Link Icons
  • Really Simple SSL
  • Slider Revolution
  • TinyMCE Advanced
  • WP Mail SMTP

Sorry if this is very vague, feel free to ask questions back ! Thank you for your time.

Edit : I don't know if it's really worth mentioning, but when I load the page, it gives me an error from Google saying "This page can't load Google Maps correctly."

Edit : Okay, so as @Rup suggested, I've found some information when I looked into the source code for the page. Turns out I found this (some values were changed to keep the location and website private) :

<input type="hidden" id="skt-gmap-content" value="The address" />
    <script src=".exp&amp;sensor=false"></script>
    <script type="text/javascript">
    var marker;
    var map;
    var ele;
    jQuery(document).ready(function() {
        ele = "";
        var contstring = jQuery('#skt-gmap-content').val(); 
        var lines = contstring.split(/\n/g);      
        for(var i=0; i < lines.length; i++) {      
             ele += lines[i];                  
        }
    });

    function sktinitializemap() 
    {
        var contentStringEle = ele;
        var contentString = contentStringEle; 
        var image = 'blue-marker.png';
        var infowindow = new google.maps.InfoWindow({content: contentString,maxWidth: 300}); // info-window text
        var myLatLng = new google.maps.LatLng('this','that'); // address in the form of latitude/lognitude

        var mapOptions = {
            zoom: 17,
            scrollwheel: false,
            center:  myLatLng,
            mapTypeControl: true,
            panControl: true,
            mapTypeControlOptions: {
              style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
            },
            zoomControl: true,
            zoomControlOptions: {
              style: google.maps.ZoomControlStyle.LARGE
            },
            mapTypeId: google.maps.MapTypeId.ROADMAP        }

        map = new google.maps.Map(document.getElementById('map'),mapOptions);
        // add google map marker
        marker = new google.maps.Marker({
            position: myLatLng,
            map: map,
            icon: image,
            title:"The address",
            animation: google.maps.Animation.BOUNCE     });

        // open info-window at marker click event
        google.maps.event.addListener(marker, 'click', function() {
            infowindow.open(map,marker);
        });

        // check info-window status
                    infowindow.open(map,marker);
            skt_moveMap(skt_moveMap, 10);
            }

    function skt_moveMap() {
        map.panBy(0, -100);
    }

    // initialize the map at window load event
    google.maps.event.addDomListener(window, 'load', sktinitializemap);
    </script>  

Now I don't know if this code was implemented manually or if a plugin did it, cause I really can't find more info than this. By the look of the variables' names and comments, I'd say it was done by hand but I wouldn't know where the file is located. I'm gonna try and dig around the files to find it.

Closed. This question is off-topic. It is not currently accepting answers.

Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?

Closed 4 years ago.

Improve this question

Recently, a client contacted me to make a few modifications on their website. Now consider that I'm not the person who made this website. It was supposed to be easy ; add a few lines here and there, change the contact information, update the address shown on the google maps and voilà !

But unfortunately, things didn't go so well for that last part. When you go on their website, in the contact page you see this google maps and a pin on it with the address attached. I thought "it's probably inserted either via a plugin or manually on the page". Turns out it's neither ! I cannot find a single trace of google maps on this website's configuration. Same on the page, there is nothing that indicates that a google maps was inserted, and I really need to change this address, but quite frankly I don't know how to.

(This might be a bit of stupid question, I'm still a student at the moment and I haven't done Wordpress in a looong while.)

I don't really know what I can share to make answering this question easier, because of the client's privacy. One thing I can do for sure though is let you know which plugins are already installed (maybe it's in one of them and I missed it ?) :

  • Akismet Anti-Spam
  • All in One SEO Pack
  • BackWPup
  • Contact Form 7
  • Custom Login Page Customizer
  • Event Espresso
  • Event Espresso - Grid View Template
  • Fancy Gallery
  • Flamingo
  • iframe
  • iThemes Security
  • MimeTypes Link Icons
  • Really Simple SSL
  • Slider Revolution
  • TinyMCE Advanced
  • WP Mail SMTP

Sorry if this is very vague, feel free to ask questions back ! Thank you for your time.

Edit : I don't know if it's really worth mentioning, but when I load the page, it gives me an error from Google saying "This page can't load Google Maps correctly."

Edit : Okay, so as @Rup suggested, I've found some information when I looked into the source code for the page. Turns out I found this (some values were changed to keep the location and website private) :

<input type="hidden" id="skt-gmap-content" value="The address" />
    <script src="https://maps.googleapis/maps/api/js?v=3.exp&amp;sensor=false"></script>
    <script type="text/javascript">
    var marker;
    var map;
    var ele;
    jQuery(document).ready(function() {
        ele = "";
        var contstring = jQuery('#skt-gmap-content').val(); 
        var lines = contstring.split(/\n/g);      
        for(var i=0; i < lines.length; i++) {      
             ele += lines[i];                  
        }
    });

    function sktinitializemap() 
    {
        var contentStringEle = ele;
        var contentString = contentStringEle; 
        var image = 'blue-marker.png';
        var infowindow = new google.maps.InfoWindow({content: contentString,maxWidth: 300}); // info-window text
        var myLatLng = new google.maps.LatLng('this','that'); // address in the form of latitude/lognitude

        var mapOptions = {
            zoom: 17,
            scrollwheel: false,
            center:  myLatLng,
            mapTypeControl: true,
            panControl: true,
            mapTypeControlOptions: {
              style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
            },
            zoomControl: true,
            zoomControlOptions: {
              style: google.maps.ZoomControlStyle.LARGE
            },
            mapTypeId: google.maps.MapTypeId.ROADMAP        }

        map = new google.maps.Map(document.getElementById('map'),mapOptions);
        // add google map marker
        marker = new google.maps.Marker({
            position: myLatLng,
            map: map,
            icon: image,
            title:"The address",
            animation: google.maps.Animation.BOUNCE     });

        // open info-window at marker click event
        google.maps.event.addListener(marker, 'click', function() {
            infowindow.open(map,marker);
        });

        // check info-window status
                    infowindow.open(map,marker);
            skt_moveMap(skt_moveMap, 10);
            }

    function skt_moveMap() {
        map.panBy(0, -100);
    }

    // initialize the map at window load event
    google.maps.event.addDomListener(window, 'load', sktinitializemap);
    </script>  

Now I don't know if this code was implemented manually or if a plugin did it, cause I really can't find more info than this. By the look of the variables' names and comments, I'd say it was done by hand but I wouldn't know where the file is located. I'm gonna try and dig around the files to find it.

Share Improve this question edited Sep 8, 2020 at 9:58 almecin asked Sep 8, 2020 at 8:28 almecinalmecin 32 bronze badges 12
  • Yes, thanks, the exact error message is absolutely worth mentioning whenever you've got a problem. (And worth search for too if you haven't already: there are plenty of hits for it.) Normally Google give links to their documentation with errors, something like "Do you own this website?", with instructions to fix. If it's not there in the UI then I'd check the console in your browser's developer tools to see if there are more details and any links to documentation there. – Rup Commented Sep 8, 2020 at 9:07
  • Do you have a link to the page? – TomC Commented Sep 8, 2020 at 9:10
  • No, sorry. Hopefully there's a link on your page with the broken map? – Rup Commented Sep 8, 2020 at 9:12
  • @Rup I saw the instructions, but they aren't really helpful to me I think since this isn't my website at all. I don't know if their billing acount is attached to it, and I don't think they used an API key, since the google maps has this watermark "for development purposes only". But is this relevant to my question at all ? My problem is finding where the configuration for this google maps is at the moment. – almecin Commented Sep 8, 2020 at 9:28
  • Oh, sorry, misunderstood. I'd view source on the page with the map and find something that's going to be unique to the map e.g. the name of the script it includes, then search all of your plugin and theme files for that string. I'd guess it's in a page-specific template in your theme for that page. – Rup Commented Sep 8, 2020 at 9:31
 |  Show 7 more comments

1 Answer 1

Reset to default 1

The map is output in the page template. A search of Github for the term skt_moveMap() (which seemed like a unique function name) revealed that the Google Maps code from your question is part of the "Contact page Template with Sidebar" (template-contact-with-sidebar.php) or "Contact page Template" (template-contact-page.php) templates included in themes from SketchThemes.

Looking at this template I could see that the map position was determined by the theme's settings, and I was able to find where those were simply by going to the theme author's website, going to their documentation, and selecting one of the theme's I'd found. That documentation clearly shows where these settings are.

Checking your plugin or theme's support resources should always be the first place to look.

本文标签: pluginsWhere is my google maps on my page