Title: [Plugin: Basic Google Maps Placemarks] error when adding do shortcode to function.php
Last modified: August 20, 2016

---

# [Plugin: Basic Google Maps Placemarks] error when adding do shortcode to function.php

 *  Resolved [andy3000](https://wordpress.org/support/users/andy3000/)
 * (@andy3000)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-error-when-adding-do-shortcode-to-functionphp/)
 * I have added the following to functions.php
    I am trying to place the map on 
   the front page of a blog where Reading Settings is set to _front page shows latest
   posts_ I get the following error: **Parse error: syntax error, unexpected T_VARIABLE
   in /home/content/40/9512840/html/wp-content/themes/wp-creativix/functions.php
   on line 16** Wasn’t sure if return_true should be proceeded with one _ or two
   but either way i get the error.
 *     ```
       function bgmpShortcodeCalled()
       {
       	global $post;
   
       	$shortcodePageSlugs = array(
       		'home'
       	);
   
       	if( $post )
       		if( in_array( $post->post_name, $shortcodePageSlugs ) )
       			add_filter( 'bgmp_map-shortcode-called', '__return_true' );
       }
       add_action( 'wp', 'bgmpShortcodeCalled' );
       ```
   
 * [http://wordpress.org/extend/plugins/basic-google-maps-placemarks/](http://wordpress.org/extend/plugins/basic-google-maps-placemarks/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Ian Dunn](https://wordpress.org/support/users/iandunn/)
 * (@iandunn)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-error-when-adding-do-shortcode-to-functionphp/#post-2960355)
 * Did you recently upgrade to version 1.8? I accidentally overwrote the tags/1.8
   directory with trunk about 30 minutes ago, but it’s fixed now. If you reinstall
   1.8 that will fix it.
 * If not, could you copy the entire functions.php file to pastebin.com and post
   a link here?
 *  Thread Starter [andy3000](https://wordpress.org/support/users/andy3000/)
 * (@andy3000)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-error-when-adding-do-shortcode-to-functionphp/#post-2960397)
 * I had not upgraded but I did and I corrected an error in the php file but now
   I’m getting
 * > 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.
   > See the FAQ for details.
 * even though I added the filter code above.
 *  Thread Starter [andy3000](https://wordpress.org/support/users/andy3000/)
 * (@andy3000)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-error-when-adding-do-shortcode-to-functionphp/#post-2960406)
 * [Here is the functions file in pastebin.](http://pastebin.com/HYvXGsd6) Note 
   that error has changed to the one in the post directly above this. (Its telling
   me I need to ad the filter)
 *  Plugin Author [Ian Dunn](https://wordpress.org/support/users/iandunn/)
 * (@iandunn)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-error-when-adding-do-shortcode-to-functionphp/#post-2960462)
 * I think the home page might be a special case; I’m not sure the page slug works
   for a page that’s assigned as the home page. Try adding code inside the `bgmpShortcodeCalled()`
   function, at the bottom.
 *     ```
       if( is_front_page() || is_home() )
       		add_filter( 'bgmp_map-shortcode-called', '__return_true' );
       ```
   
 *  Thread Starter [andy3000](https://wordpress.org/support/users/andy3000/)
 * (@andy3000)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-error-when-adding-do-shortcode-to-functionphp/#post-2960469)
 * That code works. As an obvious place to use the map plugin is probably on the
   front page that shows latest posts you might want to add that code to the installation
   directions. Thanks!
 *  Plugin Author [Ian Dunn](https://wordpress.org/support/users/iandunn/)
 * (@iandunn)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-error-when-adding-do-shortcode-to-functionphp/#post-2960488)
 * Good point, I’ll update that in the next release.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘[Plugin: Basic Google Maps Placemarks] error when adding do shortcode
to function.php’ is closed to new replies.

 * ![](https://ps.w.org/basic-google-maps-placemarks/assets/icon-128x128.png?rev
   =1152531)
 * [Basic Google Maps Placemarks](https://wordpress.org/plugins/basic-google-maps-placemarks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/basic-google-maps-placemarks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/basic-google-maps-placemarks/)
 * [Active Topics](https://wordpress.org/support/plugin/basic-google-maps-placemarks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/basic-google-maps-placemarks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/basic-google-maps-placemarks/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Ian Dunn](https://wordpress.org/support/users/iandunn/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-error-when-adding-do-shortcode-to-functionphp/#post-2960488)
 * Status: resolved