• Moderator bcworkz

    (@bcworkz)


    The file class.category-monthly-archives-model.php contains an error that causes all month name output to be (in English sites) “December” regardless of the actual month of posts.

    The script tries to translate the month number to a name twice, which makes the second attempt’s return invalid due to invalid input. Garbage in, garbage out.

    Change line 94 (which needlessly uses $wp_locale()) to this:
    $date = sprintf( '%1$d-%2$02d', $result->year, $result->month );

    The next line (with mysql2date()) can then correctly translate number to name.
    You may remove or comment out line 20 (global $wp_locale;) as well.

    Props @tathastu for reporting the error in the Support Forums.

Viewing 1 replies (of 1 total)
  • tathastu

    (@tathastu)

    Props to you @bcworkz
    That was quick and efficient.

    You’re a genius.
    I’ve been grappling with the code for a couple of weeks now.

    Problem Solved.

    Thank you

Viewing 1 replies (of 1 total)
  • The topic ‘Month Name Error [Solved]’ is closed to new replies.