Pular a navegação

Este tópico contém 0 respostas, tem 0 vozes.

Última atualização: aigarsM 1 semana, 5 dias atrás.

Assistido por: Shekhar Bhandari.

Autor Posts
fevereiro 25, 2025 em 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 oculto

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?

fevereiro 25, 2025 em 8:15 am