Support

Home Forums Event Espresso Premium Get venue name in the template

Get venue name in the template

Posted: June 27, 2019 at 8:17 am

Viewing 2 reply threads


sarahschaef

June 27, 2019 at 8:17 am

How to I get the Venue name in my template loop?

I was thinking something like this <?php espresso_venue($post->ID); ?>
since I’m using this for the date <?php espresso_next_upcoming_datetime($post->ID); ?>


sarahschaef

June 27, 2019 at 8:32 am

For the query I used this:

$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;		
$atts = array(
	'paged' => $paged,
	'title' => NULL,
	'limit' => 100,
	'css_class' => NULL,
	'show_expired' => FALSE,
	'month' => NULL,
	'category_slug' => 'events',
	'order_by' => 'start_date',
	'sort' => 'ASC'
);
// run the query
global $wp_query;
$wp_query = new EventEspresso\core\domain\services\wp_queries\EventListQuery( $atts );
	if (have_posts()) : while (have_posts()) : the_post();


Josh

  • Support Staff

June 27, 2019 at 8:56 am

Hi,

There’s a template tag available for that. (FYI you can look in the EE plugin’s /public/template_tags.php file for more like tags)

espresso_venue_name( 0, 'none', true);

or

$venue_name = espresso_venue_name( 0, 'none', false);
echo $venue_name;
Viewing 2 reply threads

The support post ‘Get venue name in the template’ 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