Posted: May 13, 2013 at 9:48 am
Hey there, Could you tell me the exact shortcode I’d use to enter the Event Registration End Date into my themes template files please? I’ve found this ‘registration_end’ in your shortcode template variables, but not sure exactly what code I’d use. I don’t want a label or anything, I just want a way to post the end date. If you could help, it would be much appreciated. Andrew | |
Hello Andrew, You could add this code to your registration_page_display.php template file around line 44. <?php echo “Registration ends on: ” . $reg_end_date; ?> Be sure to move that file and the registration_page.php file to your wp-content/uploads/espresso/templates directory to prevent them from being overwritten during and upgrade. | |
Or you can copy the registration_page_display.php file to your active WP theme folder, then you don’t need to copy registration_page.php anywhere. | |
Hey Gents, Many thanks for that. I’ve already copied my template files to the uploads folder, as I’ve made some quite significant layout changes to the registration_page_display.php file – you have just completed the final change id like to make by giving me the correct piece of code. Thanks very much for taking time out of your day to help me out. Andrew | |
You are very welcome, Jeanette. Glad we could help. If you have time in your busy schedule, would you be so kind to visit this page to see how you can help us get the word out about Event Espresso? http://staging.eventespresso.com/about/help-us-help-you-how-to-share-event-espresso/ | |
Thanks Jonathan. Another quick question, is there any way I can change the date format that that piece of code generates? Currently it prints the date like 2013-05-31 – id like to print the date as 31 May 2013 | |
Hi Andrew, You can use the PHP strtotime and date functions to convert and format the date. Here is a code example: <?php $my_reg_end = strtotime( $reg_end_date ); $my_reg_end_display = date( 'd M Y ', $my_reg_end); echo "Registration ends on: " . $my_reg_end_display; ?> | |
Ahh you legend. That did the job nicely. Thanks, Josh. Andrew | |
The support post ‘How Can I Insert the Registration End Date Into my Template Files?’ 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.