Posted: April 7, 2013 at 9:10 am
|
Hi, I’m trying to display a countdown of the days to go of an event. I’ve been referring to the following post (https://eventespresso.com/forums/2010/10/display-a-count-down-or-time-since-an-event-started/) . I’m not 100% sure how to add the code to event _post.php and whether it is still relevant. Further, I do not understand how to display (short_code) the espresso_countdown in a event i have created. I need advise for the following: Regards |
|
Hello Gerhard, The forum post is old but the code still seems valid. I actually didnt know this existed so its an interesting find! There is no shortcode attached to this code, it therefore needs to be added to the template files or you need to create a shortcode for it. This code, when added to the event_registration_display.php worked fine and I am sure that it would work just as well in the event_list_display.php
|
|
Hi Dean Thanks for the quick response. Can you advise me on how to create a shortcode for this? Would be nice to give it to users who want to edit their own event accordingly… Thnks |
|
Hi, No problem. Actually yes I can help you with that. I started making one whilst playing with this. I will be updating it with extra features for VIP members, but here is the basic shortcode: https://gist.github.com/Apina/568dbb38be956f314a64 It needs to be added to the custom_shortcodes.php that comes with the Custom files add on. You can add it directly the to shortcodes.php file but I strongly advise against it as it is a core file. |
|
Legend! |
|
Let me know how it goes! |
|
Hey Dean Thanks, [EVENT_COUNTDOWN] works nicely. My last question is if it will also be possible to create a Registration Countdown? I don’t want to abuse your time too much, but it will be handy to show people a countdown until when the registration time closes. From what i can see from your [EVENT_COUNTDOWN] custom code i would just have to change the $start_timestamp and $end_timestamp to the according registration_timestamp code? Your advice is really appreciated. G |
|
Hi Gerthard, I had a quick look at this hoping the same (swap from event date to registration date) but no, the shortcode calls a function ( espresso_event_time ) in the time_date.php file and this seems to only refer to the event date/time not registration. As such you would need to copy this over to the custom files add on and rename and modify it to use the registration time/date and then create a new shortcode based on it which would basically be a copy of the one you have but reffering to the new function. |
The support post ‘How do i use espresso_countdown in event _post.php ?’ 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.