Calendario del WordPress
Autor: jgarcia | Archivado en: BdW, General, PHP el día 13/Ene/2005
Deprecated: Function eregi() is deprecated in /home/bitacora/public_html/wp-content/plugins/wp-codebox/main.php on line 171
Deprecated: Function eregi() is deprecated in /home/bitacora/public_html/wp-content/plugins/wp-codebox/main.php on line 171
Deprecated: Function eregi() is deprecated in /home/bitacora/public_html/wp-content/plugins/wp-codebox/main.php on line 171
Deprecated: Function eregi() is deprecated in /home/bitacora/public_html/wp-content/plugins/wp-codebox/main.php on line 171
Deprecated: Function eregi() is deprecated in /home/bitacora/public_html/wp-content/plugins/wp-codebox/main.php on line 171
Deprecated: Function eregi() is deprecated in /home/bitacora/public_html/wp-content/plugins/wp-codebox/main.php on line 171
Deprecated: Function eregi() is deprecated in /home/bitacora/public_html/wp-content/plugins/wp-codebox/main.php on line 171
Deprecated: Function eregi() is deprecated in /home/bitacora/public_html/wp-content/plugins/wp-codebox/main.php on line 171
Deprecated: Function eregi() is deprecated in /home/bitacora/public_html/wp-content/plugins/wp-codebox/main.php on line 171
Deprecated: Function eregi() is deprecated in /home/bitacora/public_html/wp-content/plugins/wp-codebox/main.php on line 171
Para hacer que la semana comience el lunes y corregir el error que contiene el calendario de WordPress en español (la cabecera del calendario muestra mal las iniciales de los días de la semana) debemos seguir los siguientes pasos:
- Editamos /wp-includes/template-functions-general.php
- Modificamos el siguiente código:
- También debemos cambiar este otro segmento de código:
- Por último en este fichero:
- Editamos /wp-includes/locale.php.
- En este segmento de código:
- Por último:
1 | $pad = intval(date("w", $unixmonth)); |
por esto
1 | $pad = intval(date("w", $unixmonth)) - 1; |
1 2 | if (6 == date("w", mktime(0, 0 , 0, $thismonth, $day, $thisyear))) $newrow = true; |
por:
1 2 | if (0 == date("w", mktime(0, 0 , 0, $thismonth, $day, $thisyear))) $newrow = true; |
1 | $pad = 7 - date("w", mktime(0, 0 , 0, $thismonth, $day, $thisyear)); |
lo cambiamos para tener:
1 | $pad = 8 - date("w", mktime(0, 0 , 0, $thismonth, $day, $thisyear)); |
1 2 3 4 5 6 7 | $weekday[1] = __('Monday'); $weekday[0] = __('Sunday'); $weekday[2] = __('Tuesday'); $weekday[3] = __('Wednesday'); $weekday[4] = __('Thursday'); $weekday[5] = __('Friday'); $weekday[6] = __('Saturday'); |
realizamos este cambio:
1 2 3 4 5 6 7 | $weekday[1] = __('Monday'); $weekday[2] = __('Tuesday'); $weekday[3] = __('Wednesday'); $weekday[4] = __('Thursday'); $weekday[5] = __('Friday'); $weekday[6] = __('Saturday'); $weekday[0] = __('Sunday'); |
1 2 3 4 5 6 7 | $weekday_initial[__('Sunday')] = __('S'); $weekday_initial[__('Monday')] = __('M'); $weekday_initial[__('Tuesday')] = __('T'); $weekday_initial[__('Wednesday')] = __('W'); $weekday_initial[__('Thursday')] = __('T'); $weekday_initial[__('Friday')] = __('F'); $weekday_initial[__('Saturday')] = __('S'); |
lo sustituimos por:
1 2 3 4 5 6 7 | $weekday_initial[__('Sunday')] = __('Do'); $weekday_initial[__('Monday')] = __('Lu'); $weekday_initial[__('Tuesday')] = __('Ma'); $weekday_initial[__('Wednesday')] = __('Mi'); $weekday_initial[__('Thursday')] = __('Ju'); $weekday_initial[__('Friday')] = __('Vi'); $weekday_initial[__('Saturday')] = __('Sa'); |
…y ya tendremos el calendario en español y sin errores.
Para resolver este problema me fue de gran ayuda el el foro de Bitacoras.com.
Podéis ver otra solución en Verborea Esporádica












genial la infroamcion , un saludo a todos!!!!
Hace ya algún tiempo que teníamos que arreglar el pequeño error en el calendario, las abreviaturas de los días estaban mal traducidas, y el jueves salía como “M”. Ahora está mucho más claro “Ju”. La solución la encontramos en bitacoradewebmaster.co…
Me ha venido muy bien el tutorial este, ¡gracoas!. Una cosilla, en los pasos 2, 3 y 4 las comillas que estan alrededor de la w son diferentes, y me dió fallo al meterlo en el template-functions-general.php, para que te quede perfecto ;-)
Nota autor: Muchas gracias por tu corrección, Viktor.