Support

Home Forums Event Espresso Premium Output upcoming events on the home page?

Output upcoming events on the home page?

Posted: May 30, 2014 at 11:33 am

Viewing 3 reply threads


Simon Belcher

May 30, 2014 at 11:33 am

Hi guys,

Just getting used to EE4, I’m trying to output the entire events list onto another page but to no avail.

Does anybody know why:

<?php get_template_part( 'loop', 'espresso_events' ); ?>

Wouldnt’ work on the homepage?

Thanks folks.


Josh

  • Support Staff

May 30, 2014 at 10:41 pm

Hi Simon,

Are you including the get_template_part call within a loop? If it’s not in a loop that’s part of a query to the database for espresso_event posts, that would be one reason why it wouldn’t work.

Here’s an example of a query + loop that grabs espresso_event posts and outputs them as an unordered list.

https://gist.github.com/joshfeck/e3c9540cd4ccc734e755

The unordered list part can be replaced with a get_template_part call if you prefer.


Simon Belcher

June 3, 2014 at 1:21 pm

Ahh great stuff!

So from this how would I add some basic details like the date of said event etc?


Josh

  • Support Staff

June 4, 2014 at 10:34 am

Hi Simon,

You could use the available template tags for the event view, or even load in one of the templates we provide in the Espresso Arabica theme with get_template_part using something like:

<?php get_template_part( 'content', 'espresso_events' ); ?>

Viewing 3 reply threads

The support post ‘Output upcoming events on the home page?’ 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