このプラグインはウィジェットに対応しているので、有効化したら、ダッシュボード – 外観 – ウィジェットで表示させたいカスタム投稿タイプを選択できます。
sidebar.phpのウィジェット表示部分に自動で挿入されます。
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : ?> // ここに挿入される <?php endif; ?>
※注意:カスタム投稿の日付アーカイブはパーマリンクを設定していない場合は表示されません。
「Custom Post Type Permalinks」こちらのプラグインで設定できます。
日付、月別アーカイブはdate.phpがあればそちらに表示されます。
date.phpがなければarchive.php又はindex.php 。archive.phpを複製してdate.phpを作成してもOK
カレンダーの日付からリンクされる日付アーカイブのリンク先がhttp://~/date/2012/09/30になってしまい、通常の投稿記事が表示されてしまう。
これをhttp://~/wordpress(カスタムタイプ名)/date/2012/09/30にするとちゃんと表示されたので、いろいろ探したらフォーラムで見つけました
ダッシュボード – プラグイン – Calendar Widget For Custom Post Typesの編集でプラグインファイルのpost-types-calendar/get_calendar.phpを修正
・日付アーカイブの場合
post-types-calendar/get_calendar.php内の
$calendar_output .= '<a href="' . get_day_link~//この部分を探して下記に変更 $calendar_output .= '<a href="' . $home_url . '/' . $post_type . '/date/' . $thisyear . '/' . $thismonth . '/' . $day . '" title="' . esc_attr( $ak_titles_for_day[ $day ] ) . "\">$day</a>";
・月別アーカイブの場合
post-types-calendar/get_calendar.php内の
if ( $previous ) { $calendar_output .= "\n\t\t".'~ //この部分を下記に変更 if ( $previous ) { $calendar_output .= "\n\t\t".'<td colspan="3" id="prev"><a href="' . $home_url . '/' . $post_type . '/date/' . $previous->year . '/' . $previous->month . '" title="' . esc_attr( 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 .= "\n\t\t".'<td colspan="3" id="prev" class="pad"> </td>'; } $calendar_output .= "\n\t\t".'<td class="pad"> </td>'; if ( $next ) { $calendar_output .= "\n\t\t".'<td colspan="3" id="next"><a href="' . $home_url . '/' . $post_type . '/date/' . $next->year . '/' . $next->month . '" title="' . esc_attr( 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 .= "\n\t\t".'<td colspan="3" id="next" class="pad"> </td>'; }