Ok, this may be the code that needs to be changed:
// Get the next and previous month and year with at least one post
$previous = $wpdb->get_row("SELECT DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year
FROM $wpdb->posts
WHERE post_date < '$thisyear-$thismonth-01'
AND post_status = 'publish'
ORDER BY post_date DESC
LIMIT 1");
$next = $wpdb->get_row("SELECT DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year
FROM $wpdb->posts
WHERE post_date > '$thisyear-$thismonth-01'
AND MONTH( post_date ) != MONTH( '$thisyear-$thismonth-01' )
AND post_status = 'publish'
ORDER BY post_date ASC
LIMIT 1");
echo '<table id="wp-calendar">
<caption>' . $month[zeroise($thismonth, 2)] . ' ' . date('Y', $unixmonth) . '</caption>
<thead>
<tr>';
$day_abbrev = $weekday_initial;
if ($daylength > 1) {
$day_abbrev = $weekday_abbrev;
}
$myweek = array();
for ($wdcount=0; $wdcount<=6; $wdcount++) {
$myweek[]=$weekday[($wdcount+$week_begins)%7];
}
foreach ($myweek as $wd) {
echo "ntt<th abbr=\"$wd\" scope=\"col\" title=\"$wd\">" . $day_abbrev[$wd] . '</th>';
}
echo '
</tr>
</thead>
<tfoot>
<tr>';
if ($previous) {
echo "ntt".'<td abbr="' . $month[zeroise($previous->month, 2)] . '" colspan="3" id="prev"><a href="' .
get_month_link($previous->year, $previous->month) . '" title="' . sprintf(__('View posts for %1$s %2$s'), $month[zeroise($previous->month, 2)], date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year))) . '">« ' . $month_abbrev[$month[zeroise($previous->month, 2)]] . '</a></td>';
} else {
echo "ntt".'<td colspan="3" id="prev" class="pad"> </td>';
}
echo "ntt".'<td class="pad"> </td>';
if ($next) {
echo "ntt".'<td abbr="' . $month[zeroise($next->month, 2)] . '" colspan="3" id="next"><a href="' .
get_month_link($next->year, $next->month) . '" title="View posts for ' . $month[zeroise($next->month, 2)] . ' ' .
date('Y', mktime(0, 0 , 0, $next->month, 1, $next->year)) . '">' . $month_abbrev[$month[zeroise($next->month, 2)]] . ' »</a></td>';
} else {
echo "ntt".'<td colspan="3" id="next" class="pad"> </td>';
}
echo '
</tr>
</tfoot>
Does anyone have an idea what needs to be changed ??