It sounds like your theme is doing something odd.
Did you try the solution in the Using [bgmp-map] in a template file with do_shortcode() section of the Installation page? That should work.
Thank you,
I tried placing some code in functions.php, and [bgmp-map] on my page, where I want the map, but with no succes.
I don’t speak PHP so I do not know how to “update the function names and filter arguments”
this function bgmpShortcodeCalled()
{
global $post;
$shortcodePageSlugs = array(
‘forhandler’,
);
if( $post )
if( in_array( $post->post_name, $shortcodePageSlugs ) )
add_filter( ‘bgmp_map-shortcode-called’, ‘__return_true’ );
}
add_action( ‘wp’, ‘bgmpShortcodeCalled’ );
It looks like there’s a typo, the page slug should be forhandlere rather than forhandler.
If that doesn’t work, you can try a simpler version:
add_filter( 'bgmp_map-shortcode-called', '__return_true' );
That will load the JS/CSS on all pages, which is bad for performance, but could be an acceptable compromise if you can’t get the better version working.
Now the long version kills the site, but the simpler version worked!
I’m not happy with the slow performance, but it seems to be the only solution
Thanks
Glad to hear it’s working 🙂
The most likely cause of the site being killed is syntax errors when editing the long version. If you misplace a quotation mark, comma, semicolon, etc, PHP will crash with a fatal error.
The performance hit shouldn’t be that big of a deal; once the visitor loads the first page the CSS and JS files will be cached on all subsequent visits. They’d have to load them anyway when viewing the map, so it’s just shifting the download time from the map page to their entry page.