WordPress.org

Ready to get started?Download WordPress

Forums

WP Flexible Map
[resolved] Blank space where map should be (12 posts)

  1. axntdsgn
    Member
    Posted 8 months ago #

    Love the plugin - but I'm having the same problem as a previously resolved topic:
    [resolved] Plugin is in the code but doesnt display anything

    Inspecting the page output, the exact same code and script is displayed as the [resolved] topic. I know it's a theme issue, as it works in the Twenty Thirteen theme, but not my RocketTheme Gantry theme. I tried adding this code (one at a time, and all together):
    <?php flexmap_load_scripts(); ?> to index.php (no effect)
    <?php get_footer(); ?> to index.php (broke the site)
    <?php wp_head(); ?> to header.php (no effect)

    Other than breaking the site as noted, none individually or together fixed the problem. Any ideas on what to try next?

    http://wordpress.org/plugins/wp-flexible-map/

  2. axntdsgn
    Member
    Posted 8 months ago #

    Forgot a link to the site: A.M.E. Mechanical

    Thanks

  3. webaware
    Member
    Plugin Author

    Posted 8 months ago #

    G'day axntdsgn,

    Looks like something is stopping the Google Maps API script from registering or loading, which this plugin depends on. My usual suspect is that the theme isn't calling wp_head() or wp_footer(), but it looks like it might be here -- but please verify that both are called, should be one of each in the header.php and footer.php files respectively.

    NB: wp_footer.php -- this outputs the scripts in the page footer, usually called in footer.php but may be in your index.php

    Otherwise, there may be a conflict with the theme over the Google Maps API script. Can you search your theme for the string google-maps and see if anything shows up? In particular, I'm interested in anything registering, deregistering, or enqueuing, but let's see what you find.

    cheers,
    Ross

  4. axntdsgn
    Member
    Posted 8 months ago #

    There is "wp_head()" in "header.php", but "wp_footer()" was not in "footer.php" - so I added <?php wp_footer(); ?> just before the </body> tag. No effect (didn't break the site though, so I left it in).

    I searched the entire site for the string "google-maps" and the only file that contained it was "class.FlxMapPlugin.php" - so it seems clear that the template is just not loading a critical, yet standard piece of WordPress core code. Very disappointing for a premium theme.

    If you can think of anything else I should look for in the template files, that would be extremely appreciated. I'll attempt to get answers from RocketTheme to see what they say. I know that in cases where a 3rd party template is clearly the culprit, any help by the developer is above and beyond standard support procedures, so I'm extremely grateful for your assistance.

  5. webaware
    Member
    Plugin Author

    Posted 8 months ago #

    G'day axntdsgn,

    If you like, send me a .zip of the theme and I'll have a quick look in a test site. You can find my email address on my contact page.

    cheers,
    Ross

  6. seezee
    Member
    Posted 8 months ago #

    I'm having a similar problem. In the page source, I can see this:

    <script type='text/javascript' src='http://maps.google.com/maps/api/js?v=3.13&sensor=false'>
    </script>
    <script type='text/javascript' src='http://wp.oklahomastone.com/wp-content/plugins/wp-flexible-map/flexible-map.min.js?ver=1.7.1'></script>

    And in Developer Tools, I see:

    <script type='text/javascript' src='http://maps.google.com/maps/api/js?v=3.13&sensor=false'></script>
    <script src="http://maps.gstatic.com/intl/en_us/mapfiles/api-3/13/15/main.js" type="text/javascript"></script><script type='text/javascript' src='http://wp.oklahomastone.com/wp-content/plugins/wp-flexible-map/flexible-map.min.js?ver=1.7.1'></script>

    It's worth noting that the line <script src="http://maps.gstatic.com/intl/en_us/mapfiles/api-3/13/15/main.js" type="text/javascript"></script> appears in both the head and in the body (footer). The other thing to note is the map HTML:

    <div id="flxmap-52814e3b6b589" class="flxmap-container" data-flxmap="flxmap_52814e3b6b589" style="width:614px;height:464px;"></div>
    /* <![CDATA[ */
    (function(w, fn) {
     if (w.addEventListener) w.addEventListener("DOMContentLoaded", fn, false);
     else if (w.attachEvent) w.attachEvent("onload", fn);
    })(window, function() {
     var f = new FlexibleMap();
     f.scaleControl = true;
     f.streetViewControl = true;
     f.scrollwheel = true;
     f.region = "us";
     f.setlocale("en-US");
     f.visualRefresh = true;
     window.flxmap_52814e2a68562 = f;
    });
    /* ]]> */

    Notice that closing angle bracket for the CDATA wrapper? It's rendering as an HTML entity.

    The theme I'm using includes its own map functionality, but AFAIK, it doesn't load anything unless I specifically add its map to the page.

  7. seezee
    Member
    Posted 8 months ago #

    The comment filter mangled that last bit of code. On the live page, the closing angle bracket is rendering as an html entity, not 'greater than' sign shown above.

  8. webaware
    Member
    Plugin Author

    Posted 8 months ago #

    G'day seezee,

    Your problems are different -- the scripts are loading, but you have errors on your page. Quite apart from the obvious PHP error messages being displayed currently, you have a JavaScript error thrown by the slider script in your theme. Fix that, and the map should load.

    cheers,
    Ross

  9. seezee
    Member
    Posted 8 months ago #

    I'm not seeing the error in the slider. The theme integrates 2 sliders; which 1 are you seeing an error on?

  10. webaware
    Member
    Plugin Author

    Posted 8 months ago #

    G'day seezee,

    That JS error is gone now that you've resolved your PHP error; maybe it was related to that.

    Looking at the JS for the map, I'd guess you have an error in your shortcode. Please start a new support topic, so as to not further hijack this one, and post the shortcode you're using so that I can see the problem.

    cheers,
    Ross

  11. webaware
    Member
    Plugin Author

    Posted 8 months ago #

    @axntdsgn: my eyes! the goggles, they do nothing! :)

    That theme framework really likes to bugger up a WordPress site. Really! What a mess.

    An easy fix is to put back the wp_enqueue_scripts action, so that plugins that register their scripts normally can still work. e.g. here's a small plugin you can activate to get the maps working:

    <?php
    /*
    Plugin Name: Gantry footer script fix
    Description: Make sure footer scripts are printed in Gantry themes
    */
    add_action('init', 'wp_enqueue_scripts');

    Save that into your plugins folder as gantry-footer-fix.php, then activate it. Should fix your problems.

    Then go complain to the authors of that theme framework for breaking WordPress!

    cheers,
    Ross

  12. axntdsgn
    Member
    Posted 8 months ago #

    WooHoo!!

    Wow, I couldn't be more pleased (with you Ross) or more pissed (with RocketTheme). I guess this is what happens when a Joomla template developer gets a hold of WordPress :)

    Thanks,
    Steve

Reply

You must log in to post.

About this Plugin

About this Topic