Saltar navegación

Este tema contiene 0 respuesta, tiene 0 voces.

Última actualización por aigarsM hace 3 meses, 1 semana.

Asistido por: Shekhar Bhandari.

Autor Entradas
febrero 25, 2025 en 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: enlace 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?

febrero 25, 2025 en 8:15 am