Error with do_shortcode in template
-
Hello,
I use your plugin in the “header.php” of a “Twenty Thirteen Child” theme.
So in my header I have in a Div :
<?php echo do_shortcode('[bgmp-map]'); ?>
I have created a “functionality plugin” that code :
function bgmpShortcodeCalled() { global $post; $shortcodePageSlugs = array( // add the slugs of any pages/posts containing the map to $shortcodePageSlugs. 'reservation', 'hotels-ventoux' ); if( $post ) { if( in_array( $post->post_name, $shortcodePageSlugs ) ) add_filter( 'bgmp_mapShortcodeCalled', '__return_true' ); if( is_front_page() || is_home() ) add_filter( 'bgmp_mapShortcodeCalled', '__return_true' ); } } add_action( 'wp', 'bgmpShortcodeCalled' );
All is OK for the “home page”, the “reservation page” and for the “hotels-ventoux page”. The map is shown as I want.
But if I try to go on a page without map, I get the error message here (in french) :
Basic Google Maps Placemarks erreur : les fichiers JavaScript et/ou CSS n’ont pas pu être chargez. SI vous utilisez la fonction do_shortcode(), vous devez ajouter un filtre à votre thème. the FAQPlus de détails.
So you cannot see the site because I work in localhost with WampServer.
Can you help me please to know wher is the problem?
Thank you,
Pierrehttps://www.ads-software.com/plugins/basic-google-maps-placemarks/
- The topic ‘Error with do_shortcode in template’ is closed to new replies.