Which snippet did you add? There are two, and one of them is more error-prone than the other (but it’s also better in other ways).
Try adding only this:
add_filter( 'bgmp_map-shortcode-called', '__return_true' );
Thread Starter
paulvw
(@paulvw)
Hi Ian,
Yes Ian! That last one worked indeed!!!
Thank you so much π
Wonderful!
π
Paul
Thread Starter
paulvw
(@paulvw)
Ah… I just tried to make it responsive by adding the suggested code below, but it didn’t work.
Would you at all be willing to add the % width and height options to the option besides the pixels option?
Used ‘hack’ that was posted in the forum:
add_filter( 'bgmp_clean-map-shortcode-arguments-return', 'overide_BGMP_arguments', 100 );
function overide_BGMP_arguments( $params ) {
if( $params['mapWidth'] == '100' ) {
$params['mapWidth'] = "100%";
}
return $params;
}
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been damaged by the forum’s parser.]
@paulvw – I found that when I added that responsive code, it didn’t work if I put the “100” in the global width option in the settings (I ended up with a 100px wide strip of map). However, it does work if you put width=100 as a parameter in the shortcode when you insert the shortcode into a page.
The map is still only responsive up to a point – beyond that (eg phones), it still crops off the right of the map. However, if the map was fully responsive on phones it would probably be so small it would be difficult to decipher.
Thread Starter
paulvw
(@paulvw)
Ah, ok! Thanks. Will give it a try!
Hi, sorry to re-open this but it turns out I have this theme too to write my content in each page: DIVI Theme, but when I open a “Code block” and write this:
[bgmp-map placemark="1804"]
It is giving the same error as the title of this post, I want to know if I need some more configuration to make this plugin runs, thx in advance
Edit: I didn’t use the functions.php to add my code, just in the DIVI Editor
@darktek, it sounds like you’ll need to add this line of code to a functionality plugin:
add_filter( 'bgmp_map-shortcode-called', '__return_true' );
If you Google “wordpress functionality plugin”, it should give you lots of tutorials.
@ian Dunn, thank you so much, I just needed to add that filter in my functions.php π
@iandunn I am using Divi as well and added this snippet to functions.php however now it is just showing Loading Map… and never loads. Am I missing something else? Thanks!
Did you try to clean the cache? @kelseyfrizzell