Support

Home Forums Event Espresso Premium Customize EE4 template

Customize EE4 template

Posted: May 19, 2015 at 11:31 am

Viewing 7 reply threads


devjenifer

May 19, 2015 at 11:31 am

Hi,
I created an event (class) for all classes that we offer to show up on a course page. I then used the starter templates to customize single-event.php and archive-events.php.
If the event is expired how do I add “there are currently no events scheduled” in the ticket selector template and remove the datetime?

Or, is there is better way to have a list of events to show a ticket selector and the datetime only if a date is upcoming, otherwise display “nothing currently scheduled”


Josh

  • Support Staff

May 20, 2015 at 9:37 am

Hi there,

Normally what happens is if the event is expired, the ticket selector will no longer display at all. Does that happen if you temporarily remove your custom templates?


devjenifer

May 20, 2015 at 10:57 am

Yes, that is what happens. Here is the desired scenario:
1) We have a table that list all events with a button that says “add to cart”
2) They click button to open the single-event.php. That will have the Event description, the datetime and ticket selector
3) If an event is expired, can it say “this event is not currently scheduled” (the ticket selector does not have to display)


Josh

  • Support Staff

May 22, 2015 at 7:52 am

Can you post link to a gist of the single-espresso_events.php template so we can take a look and let you know where to add the code? If your template loads in any template parts, it will be helpful to have copies of those too.


devjenifer

June 5, 2015 at 12:44 pm

here is the github:
https://github.com/devjenifer/trisoutth/tree/master


Dean

June 8, 2015 at 2:21 am

How about replacing the line

<?php espresso_get_template_part( 'content', 'espresso_events-tickets' ); ?>

in content-espresso_events.php, with

<?php 
if( !$post->EE_Event->is_upcoming() ) {
	echo "There are currently no events scheduled";
}
else {
 espresso_get_template_part( 'content', 'espresso_events-tickets' );
}
?>

This will display the message if the event is expired or sold out, but display the ticket selector if the event is still upcoming.

You may want to check the methios in /wp-content/plugins/event-espresso-core-reg/core/db_classes/EE_Event.class.php if the is_upcoming() is not suitable for your needs.


devjenifer

June 8, 2015 at 12:23 pm

that worked Dean. Thank you.


Lorenzo Orlando Caum

  • Support Staff

June 8, 2015 at 1:02 pm

Thanks for letting us know Jenifer.

I’ll update this support post to resolved. If you need help with anything else, then please create a new support post in our support forums:

https://eventespresso.com/support/forums/


Lorenzo

Viewing 7 reply threads

The support post ‘Customize EE4 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