WordPress.org

Ready to get started?Download WordPress

Forums

WP Flexible Map
[resolved] Uncaught ReferenceError: FlexibleMap is not defined (7 posts)

  1. Mox911
    Member
    Posted 1 year ago #

    Having some problems displaying the map on
    http://50.28.70.2/~amwindow/wp/contact-us/

    I am revamping a customers site and they have a custom theme. I haven't had a whole lot of experience in this. If I unlink the page template from the site, the map works. I am unsure what to do at this point. I am assuming something is effected by the page's php.

    Any suggestions?

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

  2. linux4me2
    Member
    Posted 1 year ago #

    Where are you seeing the "FlexibleMap is not defined" error? That sounds more like a javascript error than a PHP error.

    I suspect that a javascript library required for FlexibleMap is not being loaded in the page template, but it is when you unlink the page template from the site.

    With the page template unlinked from the site, take a look all all the ".js" files loaded in the head tags, especially one that FlexibleMap might load. Make sure that script is loaded when the page template is linked to the site, and loaded only once.

    If you don't see a .js file, look for actual code in script tags containing FlexibleMap code. The way I'd do that is just search for "flexiblemap" in the page source on the page where the map displays correctly.

    What you're looking for is a difference in the javascript loaded on the page when it works versus when it does not.

    Once you find the library/code that's not loading on your custom page template, you can fix it by loading the library/code.

  3. Mox911
    Member
    Posted 1 year ago #

    That makes sense, thank you very much!

  4. Mox911
    Member
    Posted 1 year ago #

    ^

  5. linux4me2
    Member
    Posted 1 year ago #

    Let us know what you figure out.

  6. webaware
    Member
    Plugin Author

    Posted 1 year ago #

    @Mox911: some custom themes don't call wp_footer() in the footer. This call is needed so that WordPress can output any late-loaded scripts, including the scripts for WP Flexible Map. Just add a line like this into the footer.php file in the theme, somewhere before the </body> tag.

    <?php wp_footer(); ?>

    cheers,
    Ross

  7. Mox911
    Member
    Posted 1 year ago #

    I found the template neither called the wp_header or wp_footer. I stripped down both of them just so they called the functions and didn't effect the layout and added them to the template php pages. Everything works correctly now.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.