Symptoms
Visiting /blog/ loads the first 10 posts, as expected.
Visiting /blog/page/2/ (and onward) loads the new URL but with the same 10 posts. Nothing changes but the URL.
Setup Details
Custom Permalink Structure: /blog/%year%/%monthnum%/%day%/%postname%/
Static Posts Page: "Blog" (slug of 'blog')
I'm using home.php
to displays posts with the following markup:
<?php
/**
* The archive for blog posts
*/
get_header(); ?>
<div id="main-content">
<div class="container">
<section id="content" class="blog">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'blog-index' ); ?>
<?php endwhile; ?>
</section>
<?php get_sidebar( 'blog' ); ?>
<div class="pagination">
<?php wp_pagenavi(); ?>
</div>
</div>
</div>
<?php get_footer(); ?>
I've checked for plugin conflicts and I am running a relatively minimalistic setup. I'm using WP-PageNavi to generate the pagination.
I've also tried renaming the /blog/ page to 'blog2' with the thought that there might be a permalink conflict - same result. /blog2/page/2/ loads the same first 10 posts.
Any ideas what might be the cause here?
/blog/?paged=2
bring you to the second page of posts? If it doesn't work, then there is something screwing up the globalWP_Query
object. If it does work, then something is screwed up with the permalinks.post
or yourCPT
or both? Might be valuable to know. In short, it's probably a good idea to edit your question with the additional information needed.