なぜなのでしょうか
<?php $paged = get_query_var('paged') ? get_query_var('paged') : 1; $args = array( 'posts_per_page' => 1, 'paged' => $paged, 'nopaging' => false ); $the_query = new WP_Query($args); $n=1; ?> <div class='mypostlist'> <?php $max_num_pages = $the_query->max_num_pages; ?> <?php if($the_query -> have_posts()) : while($the_query -> have_posts()) : $the_query -> the_post(); ?> <div class="aida1"> <?php the_title(); ?><br> <?php echo $n ;?> <?php if(has_post_thumbnail()): ?> <a href="<?php the_permalink() ?>"> <?php the_post_thumbnail('index_thumbnail',array('class'=>'forsize')); ?> </a> <?php else: ?> <a href="<?php the_permalink() ?>"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/no-image.png" class="forsize" > </a> <?php endif; ?> <?php $n++; ?> <br> <dl> <dt> <?php the_time('Y.m.d') ?> </dt> </dl> </div> <?php endwhile; ?> <?php else: ?> <p>投稿がありません</p> <?php endif; ?> </div><!--mypostlink--> <?php wp_reset_postdata(); ?> <?php wp_pagenavi(); ?> コード
アドレスがhttp://localhost/myposts/page/2/?page=4%2Fこんな風になってるのです。
あなたの回答
tips
プレビュー