__wordpress__を書き換えていたら、
どこを間違えたのが、ページャーが表示されなくなってしまって困ってます。
条件分岐の設定を間違えたかもと思っています。
どう書き換えると良い状態、ページャーが表示されループが効率よく動作する状態になりますか?
single.php
<?php get_header(); ?> <main role="main"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <section id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h2> <a href="<?php the_permalink(); ?>"><?php echo get_the_title(); ?></a> </h2> <div class="post-meta"> 削除 </div> <article> <?php the_content(); ?> </article> </section> <?php endwhile; ?> <!-- pager --> <?php if ( $wp_query -> max_num_pages > 1 ) : ?> <nav class="pager"> <?php next_posts_link('« PREV'); ?> <?php previous_posts_link('NEXT »'); ?> </nav> <?php endif; ?> <!-- /pager --> <?php comments_template(); ?> <?php else: ?> <section class="post"> <h3>記事はありません</h3> <p>お探しの記事は見つかりませんでした。</p> </section> <?php endif; ?> </main> <?php get_sidebar(); ?> <?php get_footer(); ?>
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。