Do You Want to Learn Marketing or Coding? Do You Want to Learn Marketing or Coding?

WP Events Calendar Google Maps Fix for Event View

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Modern tribe provides an amazing product for events calendar.  I recommend checking out their event’s calendar pro and community calendar.  You can view this here: http://tri.be/products/

While working for a client I was having problems with the single view of an event. In Modern Tribe’s wordpress event calendar, a google map of the event location is supposed to appear when a user clicks on the single view. I was getting all of the information except for the silly google map. Modern Tribe’s support forms suggest to revert your template to the standard 2011, and deactivate all plugins to see if anything is conflicting. In my case nothing was conflicting, it was just something to do with the code. This might be because of the version of php I am running. I am not 100% sure behind the reasoning.

So after messing around I was able to fix the issue. I first went to /wp-content/plugins/the-events-calendar/views/

In /wp-content/plugins/the-events-calendar/views/single.php I changed this…

<?php if( tribe_embed_google_map( get_the_ID() ) ) : ?>
<?php if( tribe_address_exists( get_the_ID() ) ) { echo tribe_get_embedded_map(get_the_ID()); } ?>
<?php endif; 
&#91;/php&#93;

to this: 

&#91;php&#93;
<?php // if( tribe_embed_google_map( get_the_ID() ) ) : ?>
<?php // if( tribe_address_exists( get_the_ID() ) ) { echo tribe_get_embedded_map(get_the_ID()); } ?>
<?php // endif; 
if( tribe_address_exists( get_the_ID() ) ) {
	if (tribe_get_embedded_map(get_the_ID())) {
		echo tribe_get_embedded_map(get_the_ID());
	}
}
?>

After that the google maps functions worked! Yay…

Happy coding.

I Really Need

Reviewing nerdy stuff is expensive.

Consider clicking on this ad & buying that item you REALLY wanted from Amazon.

It helps a ton!

Leave Your Thoughts