WordPress.org

Ready to get started?Download WordPress

Forums

Basic Google Maps Placemarks
[resolved] JavaScript and/or CSS files aren't loaded. (15 posts)

  1. mikechapel
    Member
    Posted 2 years ago #

    I receive this message: "Basic Google Maps Placemarks error: JavaScript and/or CSS files aren't loaded. If you're using do_shortcode() you need to add a filter to your theme first."

    When I go to basic-google-maps-placemarks/functions.js I can read "inactive" and when I see Source code of the site, I can not see nor css style sheet nor the js file.

    I use WP 3.2.1. and use Residence Real State theme of Gorilla Inc.

    http://wordpress.org/extend/plugins/basic-google-maps-placemarks/

  2. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    Did you embed the map by putting the [bgmp-map] shortcode in a page, or did you call do_shortcode( '[bgmp-map]' ); inside a template file?

    If you used the shortcode, you theme probably isn't calling wp_footer() just before the closing body tag. That's the theme developer's mistake.

    If you're using do_shortcode(), you need to manually enqueue the CSS and JavaScript files. Read the FAQ for details.

    If that doesn't solve the problem, can you post the URL to the page?

  3. mikechapel
    Member
    Posted 2 years ago #

    I use [bgmp-map] in a widget

    The url is http://www.xqyluxequality.com/

    When you say :
    update the function names and filter arguments, and then add the slugs of any pages/posts containing the map to $shortcodePageSlugs. If you're using it on the home page, the slug will be 'home'.

    What you mean update function names? or filters arguments?
    Do you mean slug as [bgmp-map]
    And is neccessary to put "the theme name" at your_theme_name_bgmp_shortcod?

  4. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    It sounds like you're calling the shortcode directly, instead of using the do_shortcode() function in a theme file, so you don't need to worry about the FAQ entry.

    The map on the link you gave isn't my plugin. Do you still have it installed? If so, I'll need a link to the page where the map is located.

    Having two Google Maps on the same page can cause conflicts, so make sure the other plugin is disabled when testing mine.

  5. rquilliet
    Member
    Posted 2 years ago #

    Hi Ian,

    I have the same message ("Basic Google Maps Placemarks error: JavaScript and/or CSS files aren't loaded. If you're using do_shortcode() you need to add a filter to your theme first.") on http://www.echomagazine.org using [bgmp-map] in a post. I use WPZOOM Cadabrapress theme.

    You say :
    "If you used the shortcode, you theme probably isn't calling wp_footer() just before the closing body tag. That's the theme developer's mistake."

    How can I change that ?

    Thanks a lot for your help Ian

    Remi

  6. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    rquilliet, can you give a direct link to the page with the map on it?

    To check if your theme is calling wp_footer(), open footer.php in the theme folder and look at the very end of the file. It should be right before the closing body tag. Like this:

    <?php wp_footer(); ?>
    </body>
    </html>

    If it's not there, just add it.

  7. rquilliet
    Member
    Posted 2 years ago #

    Hey Ian
    Just checked : wp_footer() is called ... So it doesn't come from there ...

    Here's a link to the page with the map.

    http://echomagazine.org/2011/08/test-2/

    If I just put [bgmp-map] in an empty post, the map appears. Any conflict with the photo ? The table ? Any idea ?

    Cheers !

    Remi

  8. rquilliet
    Member
    Posted 2 years ago #

    It seems that there is a conflict with the picture.

    Here's the current code :

    [caption id="attachment_1140" align="aligncenter" width="265" caption="Echo Magazine first issue @ Vinyl Exchange, Manchester"]<img src="http://echomagazine.org/wp-content/uploads/2011/08/first_issue-e1313171230908-265x300.jpg" alt="" title="Echo Magazine first issue @ Vinyl Exchange, Manchester" width="265" height="300" class="size-medium wp-image-1140" />[/caption]
    
    As announced, the first paper issue of Echo Magazine is now available. Check the nearest stockist and don't hesitate to send us your feedback on <a href="mailto:editor@echomagazine.org">editor@echomagazine.org</a>
    
    [bgmp-map]

    If I just delete the [caption] block, then it works.

    Is there a way to put both the picture and the map ?

    Remi

  9. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    Ok, yeah, I've got the reproduced in my test environment. I'll work on getting it fixed for the next version.

  10. aenequi
    Member
    Posted 2 years ago #

    Ian, could you finish this thought from above

    When you say :
    update the function names and filter arguments, and then add the slugs of any pages/posts containing the map to $shortcodePageSlugs. If you're using it on the home page, the slug will be 'home'.

    What you mean update function names? or filters arguments?
    Do you mean slug as [bgmp-map]
    And is neccessary to put "the theme name" at your_theme_name_bgmp_shortcod?

    I believe this is the issue I am having. I'm using do_shortcode. I'm not exactly sure what I am supposed to replace the function names with. I'm not terribly well versed in wordpress. My theme is called "Duck N Roll". I tried replacing the function names several ways, but none worked.

    i.e.

    function Duck_N_Roll_bgmp_shortcode_check()
    {
        global $post;
    
        $shortcodePageSlugs = array(
            'home'
        );
    
        if( $post )
            if( in_array( $post->post_name, $shortcodePageSlugs ) )
                add_filter( 'bgmp_mapShortcodeCalled', 'Duck_N_Roll_bgmp_shortcode_called' );
    }
    add_action( 'wp', 'Duck_N_Roll_bgmp_shortcode_check' );
    
    function Duck_N_Roll_bgmp_shortcode_called( $mapShortcodeCalled )
    {
        return true;
    }

    and

    function ducknroll_bgmp_shortcode_check()
    {
        global $post;
    
        $shortcodePageSlugs = array(
            'home'
        );
    
        if( $post )
            if( in_array( $post->post_name, $shortcodePageSlugs ) )
                add_filter( 'bgmp_mapShortcodeCalled', 'ducknroll_bgmp_shortcode_called' );
    }
    add_action( 'wp', 'ducknroll_bgmp_shortcode_check' );
    
    function ducknroll_bgmp_shortcode_called( $mapShortcodeCalled )
    {
        return true;
    }

    The url is ducknrolltruck.com.

    IF you could give me your thoughts, I would greatly appreciate it. I've been trying a bunch of plugins, and yours is way better than any i tried. I usually won't wait for help like this, but it's worth it from the way it works.

  11. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    Hi aenequi. How are you determining the home page? Did you create a WordPress page and then choose it in the 'Front page displays' setting on the Reading Settings page? Or did you create a home.php file in your theme directory?

    It looks like it won't work with the home.php method. If you're using that, try switching to the other method and let me know if that works. I'll update the FAQ to let others know.

  12. aenequi
    Member
    Posted 2 years ago #

    I did neither. It's in the index.php file.

  13. aenequi
    Member
    Posted 2 years ago #

    Did I get the syntax right in one of the code snippets I posted? If I did, then I'll go ahead and try the method you suggest trying.

  14. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    Yeah, it worked for me using both of the versions you posted. index.php is a generic template that gets called in a lot of different circumstances. It'd probably better form to setup a template specifically for the home page, create a page for it, assign the template to that page, and then choose that page in the 'Front page displays' setting.

  15. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    rquilliet, this is fixed in 1.4

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic