Support

Home Forums Event Espresso Premium Customizing Events Grid Layout

Customizing Events Grid Layout

Posted: December 1, 2020 at 6:26 am


Vuxe

December 1, 2020 at 6:26 am

Hello,

We are currently using the grid layout to display our event list.
So far we have: title, excerpt, date and hour of the events.
We would like to also add the location of the event (ex: Paris)
Do you know if there is a way to display it?

Thank you


Tony

  • Support Staff

December 1, 2020 at 9:26 am

Hi there,

You can load a custom version of the grid template by copying the template into your theme and modifying it there.

So you would copy /eea-events-grid-view-template/templates/espresso-grid-template.template.php

Place that in your theme’s root directory (preferably a Child Theme) and you add additional details to the output there.

Assuming your event is using a venue you could pull the venue from the event using something like:

$venues = $post->EE_Event->venues();
$venue = reset($venues);
if ($venue instanceof EE_Venue) {
	//$venue is an EE_Venue object, use it to pull whatever value you need.
}

So in your example, you just want the city so in the above code you could add:

$city = $venue->city();

Then output the city variable where you need it to be.

Is that what you are looking for?


Vuxe

December 2, 2020 at 1:29 am

Yes, perfect! Thank you for your help!


Tony

  • Support Staff

December 2, 2020 at 2:04 am

You’re most welcome.

The support post ‘Customizing Events Grid Layout’ 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