So I purchased a premium wordpress theme, but I can’t get through its Polish localization – the dates outside the_time or the_date are displaying in English (default server’s language). I read that I have to use setlocale(LC_ALL, ‘pl_PL’); to change it, but I don’t know in which file or where it should be included and/or if I need something more. Below is an excerpt of code displaying English date:
$event_date = get_post_meta(get_the_ID(), 'event_date');
$event_from_time = get_post_meta(get_the_ID(), 'event_from_time');
$event_to_time = get_post_meta(get_the_ID(), 'event_to_time');
$event_address = get_post_meta(get_the_ID(), 'event_address');
echo date('j F Y', strtotime($event_date[0])).' '.$event_from_time[0].' do '.$event_to_time[0];
I appreciate your time and help.
Use
date_i18n( $format, $i );
See also: How to integrate get_post_time with date_i18n function?