Support

Home Forums Event Espresso Premium How to display list of dates of a recurrent event

How to display list of dates of a recurrent event

Posted: January 21, 2014 at 4:20 am


Marion Le Flohic

January 21, 2014 at 4:20 am

Hi,

I’m having difficulties to show the event date (or list of dates if it’s recurrent event) both in the event list page and the event page, .
Could you help me please?
My beta is there: http://luna2.digitalchills.com

Best regards,

Marion.


Dean

January 21, 2014 at 6:17 am

Hi Marion,

The templates look to be modified so it is likely due to an incorrect modification. If the default templates are used do the dates show correctly? You can temporarily rename the wp-content/uploads/espresso folder via FTP to force the plugin to use the default templates.


Marion Le Flohic

January 21, 2014 at 8:54 am

Hi Dean,

Yes, but when it’s a recurrent event it only show the first event date, and I would like to display all of them.


Josh

  • Support Staff

January 21, 2014 at 1:02 pm

Hi there,

Event Espresso displays all the event dates automatically, but as Dean mentioned, it appears there are modified templates in the /wp-content/uploads/espresso/templates. Since there are so many templates in there, it may be best to rename the event_list.php file that is there so the built in Event Espresso event list template will load instead.


Marion Le Flohic

January 21, 2014 at 2:17 pm

Thanks for your reply Josh.
Seems that the code used in the customs templates was right, but the strtotime that is used to display the dates didn’t work because I modified the locale.php of wordpress in order to get the month name in French.
Big problem there in WordPress with the date translation. I know it’s not an ‘event espresso issue’ but any advice to get the month’s names in french?

Best regards,
Marion.


Josh

  • Support Staff

January 21, 2014 at 2:49 pm

How was it modified? Usually you can get the Month names to translate by means of a language file. Or if they’re not in the language file, the gettext filter will let you translate them by using a function like this:

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


Marion Le Flohic

January 21, 2014 at 2:53 pm

Thanks a Lot Josh, I will try that.


Dean

January 22, 2014 at 12:44 am

Please let us know how you get on.


Marion Le Flohic

January 22, 2014 at 6:48 am

No results yet.. I’m going to install WPML plugin and see if it works.


Marion Le Flohic

January 23, 2014 at 1:17 am

Nothing, I can’t figured out.
Can you tell me if you see something wrong with this code please…?

<pre class=”brush: php; gutter: true; first-line: 1; highlight: []; html-script: false”>
<?php

if(count($start_date_recs[$recurrence_id])>1){
$count_date = 0;
echo 'Les ';
foreach($start_date_recs[$recurrence_id] as $start_date_rec){
if($count_date++ == (count($start_date_recs[$recurrence_id])-1)){
echo ' et '.date("j F Y", strtotime(event_date_display($start_date_rec, get_option('date_format'))));
}else{
if($count_date != 1){
echo ', ';
}
echo date("j", strtotime(event_date_display($start_date_rec, get_option('date_format'))));
}
}
}else{
echo 'Le ';
echo date("j F Y", strtotime(event_date_display($start_date, get_option('date_format'))));
}
?>


Josh

  • Support Staff

January 23, 2014 at 9:08 am

You might try the date_i18n function instead:

http://codex.wordpress.org/Function_Reference/date_i18n

The support post ‘How to display list of dates of a recurrent event’ 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