###■目的
WordPressでタームのアーカイブページを作りたいです。
しかし1つの記事しか表示してくれず困っています。。
###■現状の構成
【customlist.php】を表示するための、【single-custom.php】というカスタム投稿タイプがあります。
この【single-custom.php】のアーカイブページを作ろうとして下記のように書いているのですけれど、1つの記事しか表示してくれないのです。
▼【single-custom.php】
(カスタム投稿タイプのテンプレ)
php
1<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 2 3 <header class="header-area"> 4 <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> 5 </header> 6 7 <div class="entry-inner"> 8 <?php get_template_part('template-parts/customlist'); ?> 9 </div> 10 11</article>
▼【customlist.php】
(カスタムフィールドの呼び出し)
php
1<div class="name-area"> 2 <?php 3 $cf_name = SCF::get('cf_name'); 4 echo esc_html($cf_name); 5 ?> 6</div> 7<div class="day-area"> 8 <?php 9 $cf_day = SCF::get('cf_day'); 10 echo esc_html($cf_day); 11 ?> 12</div>
▼【arcive.php】
(カスタム投稿タイプのアーカイブページ)
php
1<main id="primary" class="content-area" role="main"> 2 3 <div id="posts" class="posts"> 4 5 <?php if ( have_posts() ) : ?> 6 7 <header class="header-area"> 8 <?php the_archive_title( '<h1 class="entry-title">', '</h1>' ); ?> 9 </header> 10 11 <?php /* Start the Loop */ ?> 12 <?php while ( have_posts() ) : the_post(); ?> 13 <?php get_template_part('template-parts/customlist'); ?> 14 <?php endwhile; ?> 15 <?php the_posts_navigation(); ?> 16 <?php else : ?> 17 <?php get_template_part( 'template-parts/content', 'none' ); ?> 18 <?php endif; ?> 19 20 </div><!-- .posts --> 21 22</main><!-- #main -->
以上の構成で、なぜか1つの記事しか表示してくれないのです。
直すところをご指摘いただければと思い質問いたしました。
よろしくお願い致します。m(_ _)m
あなたの回答
tips
プレビュー