投稿一覧ページを表示させる
functions.phpで一覧ページのslug名を設定すると/slug/でリンク可能になる。
// 投稿のアーカイブページを作成する function post_has_archive($args, $post_type) { if ('post' == $post_type) { $args['rewrite'] = true; // リライトを有効にする $args['has_archive'] = 'news'; // 任意のスラッグ名 } return $args; } add_filter('register_post_type_args', 'post_has_archive', 10, 2);
archive.phpを設定する