Support » Plugin: Basic Google Maps Placemarks » Enable automatic CSS and JS loading

  • Greetings,

    I’m getting stuck trying to figure out how to enable automatic CSS and JS loading.

    For efficiency, the plugin only loads the required JavaScript, CSS and markup files on pages where it detects the map shortcode is being called.

    In my case I need them to be loaded all the time, as there are some spots where the page slug is not available. I’ve checked the installation guide and the do_shortcode works well on the most pages, though, as I mentioned before, I need to disable the slug-check and make the JS/CSS available all the time.

    I appreciate any help! Thanks in advance

Viewing 4 replies - 1 through 4 (of 4 total)
  • Guys please help me out. Need to get this job done as soon as possible, though the disabled autoload prevents me from finishing it.

    Plugin Author Ian Dunn


    This should work:

    function bgmpShortcodeCalled()
                add_filter( 'bgmp_map-shortcode-called', '__return_true' );
    add_action( 'wp', 'bgmpShortcodeCalled' );

    Thanks for your reply.

    I’ve added your code to the functions.php though it doesn’t work in my case.

    Here is what I’m trying to achieve:
    I’m calling a custom shortcode on a WordPress page, which includes some custom search form. When the visitor clicks on search, an additional *.php file is called using AJAX, showing the search results. What I’m trying to do is include a BGMP map in the search results (called with AJAX), with dynamically generated BGMP options.

    The *.php, which is loaded using AJAX includes the wp-load.php file, so all WP functions shall be working fine. When I echo do_shortcode('[bgmp-map]'); I’m still getting this error – “Basic Google Maps Placemarks error: JavaScript and/or CSS files aren’t loaded”. Tried including the CSS & JS files directly in my files, but it doesn’t work also :(.

    Hope these are enough details.

    Please let me know if it’s possible. I’ve spent loads of hours to find a solution, but without success. Can’t find any workaround for this one… Got to finish my project tomorrow, haven’t got any proper solution yet. Thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Enable automatic CSS and JS loading’ is closed to new replies.