投稿記事一覧ページの下に「次のページへ」のリンクを付けたいのですが、
おそらく以下のコードの中に記述すれば反映されると思うのですが、どのように記載すればよいでしょうか?
以下は「個別投稿ページ (page.php)」というテンプレートファイルです。
php
1<?php 2/** 3 * The template for displaying all pages 4 * 5 * This is the template that displays all pages by default. 6 * Please note that this is the WordPress construct of pages 7 * and that other 'pages' on your WordPress site may use a 8 * different template. 9 * 10 * @link https://codex.wordpress.org/Template_Hierarchy 11 * 12 * @package ~~~~~ 13 */ 14 15get_header(); ?> 16 17 <div id="primary" class="content-area"> 18 <main id="main" class="site-main"> 19 20 <?php 21 while ( have_posts() ) : the_post(); 22 23 get_template_part( 'template-parts/content', 'page' ); 24 25 // If comments are open or we have at least one comment, load up the comment template. 26 if ( comments_open() || get_comments_number() ) : 27 comments_template(); 28 endif; 29 30 endwhile; // End of the loop. 31 ?> 32 33 </main><!-- #main --> 34 </div><!-- #primary --> 35 36<?php 37get_sidebar(); 38get_footer(); 39?>
回答1件
あなたの回答
tips
プレビュー