I have implemented a no-plugin pagination taken from here: http://www.kriesi.at/archives/how-to-build-a-wordpress-post-pagination-without-plugin

It's works perfecto un normal loop but when I try to use in author pages, categories, archives, tags and search results everything goes bad.

The pagination works but when the link it generate load then everything woes wrong.

The code:

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
    'posts_per_page' => '3',

query_posts( $args );

h**p://localhost/?author=1&paged=1 works perfect, load author.php template.

h**p://localhost/?author=1&paged=2 redirects me to home page.

If I change &paged with &page the it works but the stander loop in index.php used paged by default and I want the same paginator working in the hole website.

It's like wordpress do something special with "paged" parameter.

¿Any tip or suggestion?

Thanks in advance

1 Answer 1


This looks like a simular issue to this one with wp-pageNavi: http://scribu.net/wordpress/wp-pagenavi/right-way-to-use-query_posts.html.

Taxonomies and archives should use 'page', not 'paged' so use that in the urls to begin with.

Then, to ensure your pagination script works in all locations you can change the way you get your $paged variable.

Something like this should do it:

if (is_archive()) {
     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
} else {
     $paged = (get_query_var('page')) ? get_query_var('page') : 1;
  • Thanks Mike but unfortunately this is only the way to read is there is page or paged. The code for pagination always generate the paged var and not page o paged selective. I have tried even to make the pagination function to use paged o page but the function use a get_pagenum_link() to generate the link. Ok, I can change the function for another of my own creation but I'm looking always the possibility of using the most standar way of doing things. Any suggestion please? Thanks again.
    – DeryckOE
    Mar 5, 2012 at 17:53
  • I change to permalinks just to test if work but not. If y load the page localhost:8888/opengov/author/deryck all fine but when I try to load the second page localhost:8888/opengov/author/deryck/page/2 then I get a 404 error page. The URL is invalid.
    – DeryckOE
    Mar 5, 2012 at 18:08
  • I force localhost:8888/opengov/author/deryck/page/1 to test page one and It works perfects. So, if the 1 changes for 2 then i get the 404 error. Weird and annoying
    – DeryckOE
    Mar 5, 2012 at 18:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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