カスタム投稿をカレンダーに表示させるのに、WordPress Calendar For Custom Post Typesを入れてみたが、リンクが正しくない。
他のものもいくつか試してみたが、いずれも同じなので、get_calendar.php のリンク部分を
$calendar_output .= '<a href="' . get_home_url() . '/posttype-name/date/' . $thisyear . '/' . $thismonth . '/' . $day . "" title="$ak_titles_for_day[$day]">$day</a>";
に、前後ナビ部分を
if ( $previous ) { $calendar_output .= "ntt".'<td colspan="3" id="prev"><a href="' . get_home_url() . '/posttype-name/date/' . $previous->year . '/' . $previous->month . '" title="' . sprintf(__('View posts for %1$s %2$s'), $wp_locale->get_month($previous->month), date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year))) . '">« ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '</a></td>'; } else { $calendar_output .= "ntt".'<td colspan="3" id="prev" class="pad"> </td>'; } $calendar_output .= "ntt".'<td class="pad"> </td>'; if ( $next ) { $calendar_output .= "ntt".'<td colspan="3" id="next"><a href="' . get_home_url() . '/posttype-name/date/' . $next->year . '/' . $next->month . '" title="' . sprintf(__('View posts for %1$s %2$s'), $wp_locale->get_month($next->month), date('Y', mktime(0, 0 , 0, $next->month, 1, $next->year))) . '">' . $wp_locale->get_month_abbrev($wp_locale->get_month($next->month)) . ' »</a></td>'; } else { $calendar_output .= "ntt".'<td colspan="3" id="next" class="pad"> </td>'; }
に書き換えた。ポストタイプ名はリライト設定をしている場合は、その設定のとおりに。カスタム投稿のパーマリンクはCustom Post Type Permalinksで設定しています。