diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index e96f0f7c37429..54eaf0b244a10 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -2305,8 +2305,9 @@ function get_calendar( $initial = true, $display = true ) { $thismonth = current_time( 'm' ); } - $unixmonth = mktime( 0, 0, 0, $thismonth, 1, $thisyear ); - $last_day = gmdate( 't', $unixmonth ); + $current_day = current_time('j'); + $unixmonth = mktime( 0, 0, 0, $thismonth, $current_day, $thisyear ); + $last_day = gmdate( 't', $unixmonth ); // Get the next and previous month and year with at least one post. $previous = $wpdb->get_row(