WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I try to use next_posts_link() and previous_posts_link() in my archive posts page I got a 404 error page.

I'm using this permalink setting /%category%/%postname% and working well for all pages like site.com/contacts or posts like site.com/category/this-is-a-post-tile.

The only problem is in archive posts, for test I've set the number of posts per archive by 1 per page and trying with three articles to change the pages.

The paginator is simple this:

<?php get_header(); ?>
<section class="large-9 columns right-dashed articles">
    <?php if (have_posts ()) : while (have_posts ()) : the_post(); ?>
        <article class="left-icon article" id="post-<?php the_ID(); ?>">
            <a class="permalink" href="<?php echo get_permalink();?>"><h2 class="black"><?php the_title(); ?></h2></a>
            <div class="details"><?php echo __('di:').' '.get_the_author();?> / <time datetime="<?php echo get_the_date('Y-m-d H:i:s');?>"><?php echo get_the_date();?></time></div>
            <div class="entry"><?php the_excerpt(); ?></div>
            <a class="button" href="<?php echo get_permalink();?>"><?php echo __('Continue to article'); ?></a>
    <?php endwhile; endif; ?>
        // PAGINATOR
<aside class="large-3 columns to-right">
    // some menu here
<?php get_footer(); ?>

I'va always had mistakes with permalinks and pages, probably I miss some base concept of WordPress about it.

How can I do to make it work and let WordPress paginate blog pages correctly?

share|improve this question
How did you "set the number of posts per archive by 1 per page"? Post that code, please. – s_ha_dum May 3 '13 at 13:53
I did it via wordpress backoffice wp-admin > options > reading – vitto May 3 '13 at 14:32
Something is missing. I have no trouble with next_posts_link and previous_posts-link with the same permalink structure. Something is peculiar about your site. Disable your plugins and switch themes. Try to find what is causing this. – s_ha_dum May 3 '13 at 14:50
I've deactivated all the plug-in installed: Advanced Custom Fields, Disqus Comment System, Flexible Custom Post Type, WPML Multilingual CMS and WPML String Translation, refreshed the page multiple times, but the problem still the same. This is the url I call: site.com/category/page/2 does it points to archive.php or should I point to somewhere else? I'm not using other sub archives. – vitto May 3 '13 at 16:27

check your reading settings. The number of post per page has to be the same in archives too.

share|improve this answer
In archives I didn't set any number of posts, I just set it in reading setting, do you mean there is another place where I should set the number? – vitto May 3 '13 at 9:45
You said: > "for test I've set the number of posts per archive by 1 per page and trying with three articles to change the page", number of posts per page has to be the same as the number set in reading settings. – JMau May 3 '13 at 11:11
sorry for my english, i meant I've set the number of posts per archive by 1 by setting it in wp-admin > options > reading – vitto May 3 '13 at 14:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.