Encuentra usuarios de Twitter en tu ciudad con LocaFollow

votarCalendario 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:

  1. Editamos /wp-includes/template-functions-general.php
  2. Modificamos el siguiente código:
  3. ?View Code JAVASCRIPT
    1
    
    $pad = intval(date("w", $unixmonth));

    por esto

    ?View Code JAVASCRIPT
    1
    
    $pad = intval(date("w", $unixmonth)) - 1;
  4. También debemos cambiar este otro segmento de código:
  5. ?View Code JAVASCRIPT
    1
    2
    
    if (6 == date("w", mktime(0, 0 , 0, $thismonth, $day, $thisyear)))
    $newrow = true;

    por:

    ?View Code JAVASCRIPT
    1
    2
    
    if (0 == date("w", mktime(0, 0 , 0, $thismonth, $day, $thisyear)))
    $newrow = true;
  6. Por último en este fichero:
  7. ?View Code JAVASCRIPT
    1
    
    $pad = 7 - date("w", mktime(0, 0 , 0, $thismonth, $day, $thisyear));

    lo cambiamos para tener:

    ?View Code JAVASCRIPT
    1
    
    $pad = 8 - date("w", mktime(0, 0 , 0, $thismonth, $day, $thisyear));
  8. Editamos /wp-includes/locale.php.
  9. En este segmento de código:
  10. ?View Code JAVASCRIPT
    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:

    ?View Code JAVASCRIPT
    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');
  11. Por último:
  12. ?View Code JAVASCRIPT
    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:

    ?View Code JAVASCRIPT
    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


  • Digg
  • del.icio.us
  • Facebook
  • Google
  • LinkedIn
  • Meneame
  • MySpace
  • Technorati
  • TwitThis
Posts Relacionados

3 Comentarios on “Calendario del WordPress”

  1. #1 Nina dijo 7:18 pm el Enero 13th, 2005:

    genial la infroamcion , un saludo a todos!!!!


  2. #2 Accesibilidad en la red dijo 10:34 pm el Enero 16th, 2005:
    Calendario del wordpress
    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…


  3. #3 Viktor dijo 1:43 pm el Marzo 1st, 2005:

    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.



Deja un comentario.