お世話になってます。
この数日、カスタム投稿の月別アーカイブのリンク先が404エラーになってしまう事にハマってます。
色んなサイトを見て参考にしても解決できないので、皆様のお力添えをお願いしたいです。
よろしくお願い致します。
デフォルトのサイドバー1を使用しカスタム投稿songlistの月別アーカイブのウィジェットを使用しています。
2016年1月(1)
2016年2月(4)
など、投稿件数も表示されるのですが、リンク先が404エラーになります。
個別記事のURLは、
http://www.(サイトアドレス)/songlist/2016/02/04/(投稿タイトル)/
2016年2月を押した先の404エラーのURLは、
http://www.(サイトアドレス)/songlist/2016/02/
となっています。
サイドバー1を使わず、sidebar.phpに直打ちする事も試しましたが、
http://www.(サイトアドレス)/songlist/date/2016/02/
となり、同じく404エラーでした。
パーマリンク設定:月と投稿名
songlist http://www.(サイトアドレス)/songlist//%year%/%monthnum%/%day%/%postname%/
使用テーマ:bones
カスタム投稿:function.phpに記述
使用プラグイン:Custom Post Type Permalinks Vr1.4
function custom_post_example() {
register_post_type( 'songlist',
array( 'labels' => array(
'name' => __( 'Songlist', 'bonestheme' ),
'singular_name' => __( 'Custom Post', 'bonestheme' ),
'all_items' => __( 'Song一覧', 'bonestheme' ),
'add_new' => __( '新曲', 'bonestheme' ),
'add_new_item' => __( 'Add New Custom Type', 'bonestheme' ),
'edit' => __( 'Edit', 'bonestheme' ),
'edit_item' => __( 'Edit Post Types', 'bonestheme' ),
'new_item' => __( 'New Post Type', 'bonestheme' ),
'view_item' => __( 'View Post Type', 'bonestheme' ),
'search_items' => __( 'Search Post Type', 'bonestheme' ),
'not_found' => __( 'Nothing found in the Database.', 'bonestheme' ),
'not_found_in_trash' => __( 'Nothing found in Trash', 'bonestheme' ),
'parent_item_colon' => ''
), /* end of arrays */
'description' => __( 'This is the example custom post type', 'bonestheme' ),
'public' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'show_ui' => true,
'query_var' => true,
'menu_position' => 8,
'menu_icon' => get_stylesheet_directory_uri() . '/library/images/custom-post-icon.png',
'rewrite' => array( 'slug' => 'songlist', 'with_front' => false ),
'has_archive' => true,
'capability_type' => 'post',
'hierarchical' => false,
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'comments', 'revisions', 'sticky')
)
);
archive-songlist.php
<h1 class="archive-title"><?php post_type_archive_title(); ?></h1>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'cf' ); ?>>
<header class="article-header">
<h3 class="h2">
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?>
</a>
</h3>
<p class="date"><?php the_time( 'Y-m-d' ) ?></p>
</header>
</article>
<?php endwhile; ?>
<?php bones_page_navi(); ?>
<?php else : ?>
<?php endif; ?>