Can't get " French local Date"

Responsive WordPress theme suitable for Schools, Colleges or educational websites.
GK User
Tue Mar 08, 2016 2:36 pm
Hi Gavick team,
I have french date on all events category list but not in this :
http://www.tekguyane.fr/category/events-list-2/
Image

I don't know why!
Best regards
Antonio
User avatar
Junior Boarder

Joshua M
Wed Mar 09, 2016 10:19 am
Hi,

It's a date format which matchs to the layout ;)
If you want to change it, please edit University/content-event.php file around lines 61-64:

Code: Select all
<time class="entry-date" datetime="<?php echo $date_start->format('c'); ?>">
            <?php echo $date_start->format('D'); ?>   
            <span><?php echo $date_start->format('M j'); ?></span>
      </time>

Date formats may be found here:
https://codex.wordpress.org/Formatting_Date_and_Time
User avatar
Moderator

GK User
Thu Mar 10, 2016 12:14 pm
Hi Joshua,
I tried this: <?php echo date_i18n( $dateformatstring, $unixtimestamp, $gmt ); ?>
on the lign 61 of content-event.php file, like this;
<time class="entry-date" datetime="<?php echo date_i18n($date_start->format('c')); ?>">
but it don't work!
Could you be, please, more precise about the wright syntax to get french date like the homepage: http://www.tekguyane.fr/
Best regards
Antonio
User avatar
Junior Boarder

Joshua M
Thu Mar 10, 2016 1:12 pm
Hi,

Try to add a following fragment into line 19:
Code: Select all
$dateweekday = $wp_locale->get_weekday( $date_start->format('w') );
$dateweekday_abbrev = $wp_locale->get_weekday_abbrev( $dateweekday );

$datemonth = $wp_locale->get_month($date_start->format('m') );
$datemonth_abbrev = $wp_locale->get_month_abbrev( $datemonth );


and replace mentioned fragment (line 61) with:
Code: Select all
<time class="entry-date" datetime="<?php echo esc_attr(get_the_date('c')); ?>">
               <?php echo $dateweekday_abbrev; ?>   
               <span><?php echo $datemonth_abbrev .' '. $date_start->format('j'); ?></span>
         </time>
User avatar
Moderator

GK User
Thu Mar 10, 2016 5:16 pm
PERFECT!
Thanks a lot
User avatar
Junior Boarder

GK User
Thu Mar 10, 2016 7:31 pm
Hi Joshua,
Got a new bug after hack: have some "strange code" after every title post and buddypress to?
All plugins are update normaly…
Image
Image
Image
regards
Antonio
User avatar
Junior Boarder

Joshua M
Fri Mar 11, 2016 9:18 am
It's probably a mistake from your previous modifications - could you send me a PM with FTP access to your website? Then I'll be able to check the issue.
User avatar
Moderator

Joshua M
Mon Mar 14, 2016 9:18 am
It was a mistake within your layouts/content.post.header.php file:
Code: Select all
</h><?php echo (is_singular()) ? '1' : '2'; ?>>
User avatar
Moderator

GK User
Mon Mar 14, 2016 3:56 pm
Thanks a lot Joshua.
User avatar
Junior Boarder


cron