Support

Home Forums Event Espresso Premium How Can I Insert the Registration End Date Into my Template Files?

How Can I Insert the Registration End Date Into my Template Files?

Posted: May 13, 2013 at 9:48 am

Viewing 7 reply threads


Jeanette Green

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


Jonathan Wilson

May 13, 2013 at 3:36 pm

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.


Josh

  • Support Staff

May 13, 2013 at 4:00 pm

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.


Jeanette Green

May 13, 2013 at 4:56 pm

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


Jonathan Wilson

May 14, 2013 at 7:52 am

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?

https://eventespresso.com/about/help-us-help-you-how-to-share-event-espresso/


Jeanette Green

May 14, 2013 at 12:45 pm

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


Josh

  • Support Staff

May 14, 2013 at 1:28 pm

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;
?>


Jeanette Green

May 14, 2013 at 1:33 pm

Ahh you legend. That did the job nicely. Thanks, Josh.

Andrew

Viewing 7 reply threads

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.

Event Espresso