Support

Home Forums Event Espresso Premium Maps Not Displaying on Event Pages

Maps Not Displaying on Event Pages

Posted: May 2, 2016 at 8:26 am


Dan Santonocito

May 2, 2016 at 8:26 am

Hello,

I am working on the following website at http://209.59.176.85/~bassodesigngrou3/troychamber/events/may-economic-development-forum/ and we are having a problem with events not showing up on the event pages. If you click on the link for the Venue the maps are working properly but for some reason they’re not showing up on the actual events. I noticed a warning about a Google Maps API key in the console when I inspect element in Google Chrome. I am also seeing the following Error in the console.

map-functions.js?ver=1461765977:30 Uncaught ReferenceError: ee_gmap_vars is not defined

We are running the latest version of EE. Please assist.

Thanks!


Lorenzo Orlando Caum

  • Support Staff

May 2, 2016 at 8:41 am

Hello, could you update to the latest version?

https://eventespresso.com/wiki/ee4-changelog/

Also, is the show venue information option enabled in WP-admin –> Event Espresso –> Templates?

It looks like this:

http://cl.ly/1U273h3V150K


Lorenzo


Dan Santonocito

May 2, 2016 at 12:59 pm

Hi Lorenzo,

I checked and the setting is in fact enabled. I went ahead and updated everything as well and the maps are still not showing up. I even went ahead and disabled the “Show Venue” information setting and tried using the venue shortcode and that did not work either. Here is the PHP for our single event page. Can you tell me if something is missing?

<?php get_header(); ?>

<section class="section section-intro section-intro-tertiary">
	<div class="shell">
		<div class="section-content">
			<?php crb_the_title('<h2 class="section-title">', '</h2>'); ?>
		</div><!-- /.section-content -->
	</div><!-- /.shell -->
</section><!-- /.section section-intro -->

<div class="main">
	<div class="shell">
		<div class="main-inner">
			<div class="content">
				<?php if (have_posts()) : ?>
					<?php while (have_posts()) : the_post(); ?>
						<article <?php post_class('article article-single') ?>>
							<header class="article-head">
								<h2 class="article-title">
									<?php the_title(); ?>
								</h2><!-- /.article-title -->

								<div class="article-meta">
									<?php espresso_list_of_event_dates(); ?>
								</div><!-- /.article-meta -->
							</header><!-- /.article-head -->

							<div class="article-body">
								<div class="article-entry">
									<div class="mobile-map-holder">
									</div><!-- /.mobile-map-holder -->

									<div class="list-logos">
										<?php
										$crb_event_sponsors = carbon_get_the_post_meta('crb_event_sponsors', 'complex');
										if ( !empty($crb_event_sponsors) ): ?>
											<?php foreach ($crb_event_sponsors as $sponsor): ?>
												<a href="<?php echo esc_url($sponsor['link']); ?>" <?php crb_the_target($sponsor['target']); ?>>
													<?php echo crb_wp_get_attachment_image($sponsor['image'], 'crb_single_event_sponsor'); ?>
												</a>
											<?php endforeach; ?>
										<?php endif; ?>
									</div><!-- /.list-logos -->

									<?php
									the_content();
									carbon_pagination('custom');
									?>

									<div class="pricing-row">
										<?php
										$tickets = espresso_event_tickets_available(get_the_id(), false, false);
										foreach ($tickets as $ticket) : ?>
											<p>
												<?php echo EEH_Template::format_currency( $ticket->get_ticket_total_with_taxes() ); ?>
												<?php echo $ticket->name(); ?>
											</p>
										<?php endforeach; ?>
									</div><!-- /.pricing-row -->

									<?php
									/*$crb_button_title = carbon_get_the_post_meta('crb_button_title');
									$crb_button_link = carbon_get_the_post_meta('crb_button_link');
									$crb_button_target = carbon_get_the_post_meta('crb_button_target');
									if ( !empty($crb_button_title) && !empty($crb_button_link) ): ?>
										<a href="<?php echo esc_url($crb_button_link); ?>" class="btn" <?php crb_the_target($crb_button_target); ?>>
											<?php echo apply_filters('the_title', $crb_button_title); ?>
										</a>
									<?php endif;*/ ?>

									<?php
									$reg_page_id = isset(EE_Registry::instance()->CFG->core->reg_page_id ) ?EE_Registry::instance()->CFG->core->reg_page_id : NULL;
									
									$url = get_permalink($reg_page_id);
									$url = add_query_arg('event_id', get_the_id(), $url);
									?>
									<a href="<?php echo $url; ?>" class="btn">Register Now</a>

									<?php //espresso_ticket_selector(); ?>

									<div class="socials">
										<span class='st_sharethis_large' displayText='ShareThis'></span>
										<span class='st_facebook_large' displayText='Facebook'></span>
										<span class='st_twitter_large' displayText='Tweet'></span>
										<span class='st_pinterest_large' displayText='Pinterest'></span>
										<span class='st_linkedin_large' displayText='LinkedIn'></span>
										<span class='st_googleplus_large' displayText='Google +'></span>
										<span class='st_email_large' displayText='Email'></span>
									</div><!-- /.socials -->
								</div><!-- /.article-entry -->
							</div><!-- /.article-body -->
						</article><!-- /.article -->
					<?php endwhile; ?>
				<?php endif; ?>
			</div><!-- /.content -->

			<?php get_sidebar(); ?>
		</div><!-- /.main-inner -->
	</div><!-- /.shell -->
</div><!-- /.main -->

<?php get_footer(); ?>

Thanks!


Josh

  • Support Staff

May 2, 2016 at 1:43 pm

Hi Dan,

I looked through your code and I don’t see anything there that will display the venue or a map for the venue. Have you tried adding something like this?

<?php espresso_venue_gmap( $post->ID ); ?>


Dan Santonocito

May 3, 2016 at 8:17 am

Josh,

I just tried adding this code to the template and the map is still not displaying for me. I’m not sure what we’re doing wrong here?


Josh

  • Support Staff

May 3, 2016 at 9:53 am

Hi Dan,

<?php espresso_venue_gmap( get_the_id() ); ?>

Might work, if it’s within The Loop.


Dan Santonocito

May 3, 2016 at 12:07 pm

I tried using both code snippets you sent in and outside of the loop and neither one of them is working.


Josh

  • Support Staff

May 3, 2016 at 1:09 pm

Can you try clearing your browser’s cache? The reason I ask is because I see maps on your site’s event pages.


Dan Santonocito

May 3, 2016 at 1:34 pm

Yeah thats because I fixed it lol. We’re just using the widget. FYI your code did work when I removed the call to get the ID and just ran it like this …

<?php espresso_venue_gmap(); ?>

Anyway thanks for the help!

The support post ‘Maps Not Displaying on Event Pages’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso