Support

Home Forums Event Espresso Premium Venue Template Tags not Working in EE4 4.3.0p

Venue Template Tags not Working in EE4 4.3.0p

Posted: August 18, 2014 at 2:28 pm


James Kramer

August 18, 2014 at 2:28 pm

I’ve created a custom page template for my frontpage and other pages where I want to display 3 of the most soonest upcoming events.

I’m trying to display the venue name (with a link). The template tags displayed on don’t work. I get this error:

Fatal error: Call to undefined function espresso_venue_name() in...

I’m using this query so I can sort the events by start date (which should be default for all event queries).

I’ve tried to explicitly call the helpers to see if that would help and it did not.

I have not changed the plugin core and I upgraded to 4.3.0 from 4.2.9 (which was previously upgraded from 4.2.8…when I installed the plugin).

How can I display the Venue name and URL with or without Template Tags? What am I missing? The following code is the what I’m using:

<?php			
$atts = array(
	'show_expired' => FALSE,
	'order_by' => 'start_date',
	'sort' => 'ASC'
);
// run the query
global $wp_query;
$wp_query = new EE_Event_List_Query( $atts );

if (have_posts()) : ?>

		<?php while (have_posts()) : the_post(); // Start the loop. ?>

		<article class="list-event">

			<div class="event-summary">
				...
			</div>

			<div class="event-details">
				<p class="location">Location: <a href="<?php //espresso_venue_link(); ?>"><?php  espresso_venue_name( $post->ID ); ?></a></p>
			</div>

		</article>

	<?php endwhile; // end of the loop. ?> 
			
<?php else: ?>

	<p>No Upcoming Events</p>

<?php endif;
	
// now reset the query and postdata
wp_reset_query();
wp_reset_postdata(); ?>


Josh

  • Support Staff

August 18, 2014 at 6:46 pm

Hi James,

I made a few changes to your code to make the venue template tags work:

 FALSE,
	'order_by' => 'start_date',
	'sort' => 'ASC'
);
// run the query
global $wp_query;
$wp_query = new EE_Event_List_Query( $atts );
// load the venue view
EE_Registry::instance()->load_helper('Venue_View');
if (have_posts()) : ?>

		
		

		
...

Location:

No Upcoming Events
  • This reply was modified 9 years, 8 months ago by  Josh. Reason: clarification

The support post ‘Venue Template Tags not Working in EE4 4.3.0p’ 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