Salta la navigazione

Questo ticket contiene 0 risposta, ha 0 voci.

Ultimo aggiornamento da aigarsM 3 mese, 1 settimana fa.

Assistito da: Shekhar Bhandari.

Autore Messaggi
Febbraio 25, 2025 a 7:48 am

aigarsM

Background of the issue:
I am trying to output the name of the month using the wp_date function. I used the following code:

$timezone = wp_timezone();
$post_date = strtotime ( get_the_date( 'Y-m-d', $post_id ) );
$custom_date_day = wp_date( 'j.', $post_date, $timezone );
$custom_date_month = wp_date( 'F. Y', $post_date, $timezone );

Link to a page where the issue can be seen: link nascosto

Symptoms:
I expected to see the name of the month in the current language, but instead, wp_date outputs it in English.
I also checked and saw that global $wp_locale is in English (the main language is Latvian).

Questions:
How can I make wp_date output the month name in the current language instead of English?

Febbraio 25, 2025 a 8:15 am