WordPress.org

Ready to get started?Download WordPress

Forums

WP Flexible Map
[resolved] Plugin is in the code but doesnt display anything (7 posts)

  1. maRGas.
    Member
    Posted 10 months ago #

    Hi all,
    I've inserted the sample code and even tried my own code to display the plugin but I'm not having any luck.

    When I right click the big white space it has inserted and inspect element I can see it has inserted some code but it doesn't appear to be complete.

    [ Moderator note: please wrap code in backticks or use the code button. ]

    <div id="flxmap-52358c6f33c7d" class="flxmap-container" data-flxmap="flxmap_52358c6f33c7d" style="width:100%;height:400px;"></div>
    <div id="flxmap-52358c6f33c7d-dir" class="container"></div>
    <script>
    /* <![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.markerDirections = true;
     f.markerDirectionsDiv = "flxmap-52358c6f33c7d-dir";
     f.setlocale("en-US");
     f.markerTitle = "Adelaide Hills";
     f.showMarker("flxmap-52358c6f33c7d", [-34.916721,138.828878], [-34.916721,138.828878]);
     window.flxmap_52358c6f33c7d = f;
    });
    /* ]]> */
    </script>

    It's like it's missing all of the divs etc inside the main div. I am guessing I may be missing some essential javascript because I've had this working on another site.

    You can see the page here. Click on the Bell (Day at the stones)
    http://dmwebdesign.com.au/benjiandjessie/

    Many thanks.

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

  2. webaware
    Member
    Plugin Author

    Posted 10 months ago #

    G'day,

    Two things I can see:

    1. Looks like your theme is missing the get_footer() call, which is required so that the scripts are loaded for lots of different plugins

    2. There's a big chunk of PHP code pasted into the footer inside script tags, from this plugin's readme file. Not meant to be there, not like that, so delete it.

    Cheers,
    Ross

  3. maRGas.
    Member
    Posted 10 months ago #

    G'day Ross,
    Thanks for replying so quickly!

    My bad about the code in the footer. Was trying to get it working and accidentally left it there. I do have <?php get_footer(); ?> in my index.php however.

    Doesn't seem to have fixed it unfortunately. Am I completely over looking the obvious?

  4. webaware
    Member
    Plugin Author

    Posted 10 months ago #

    I'm in front of the idiot box so can't easily check, but it looks like maybe this page is loading via Ajax lazy loading. Try adding the following code to your index.php template:

    <?php flexmap_load_scripts(); ?>

    cheers,
    Ross

  5. maRGas.
    Member
    Posted 10 months ago #

    Gday again Ross,
    I did what you recommended and pasted <?php flexmap_load_scripts(); ?> into index.php but to no avail. I also tried in header and footer just for good measure but still no luck.

    I did have an ajax plugin installed (but not activated) so I deleted that just to be sure it wasn't caused by that and still no luck :(

    Dang!

    Any suggestions?

  6. webaware
    Member
    Plugin Author

    Posted 10 months ago #

    Are you able to send me login details via my contact page? I can login and have a look, see if I can see what's going on.

    cheers,
    Ross

  7. maRGas.
    Member
    Posted 10 months ago #

    RESOLVED!

    In case anybody else comes up with a problem like this. Be sure you have <?php wp_head(); ?> included in your header.php.

    Many thanks to Ross who was extremely helpful and found the problem for me.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.