Skip to content


WordPress $Paged and Page Navigation

wp-logoWeb 2 WordPress themes normally include featured articles or categories. Sometimes, popular articles, recent post or comments are likewise included. Examples of these themes are newspaper style themes displaying articles from selected categories. These themes do not usually include a page navigation. Users need to click on categories to be able to navigate deeper into articles. This seems a bit annoying.

Adding a page navigation such as the WP-PageNavi plugin will improve the navigation process. Following the installation and usage instruction from the plugin website is not enough to make the plugin work the way it is intended to be. Only the first page articles are being displayed despite any page number queried.

Example, these URLs

  • http://yourwebsite.com/
  • http://yourwebsite.com/?p=2
  • http://yourwebsite.com/index.php/paged/2
  • http://yourwebsite.com/?p=3
  • http://yourwebsite.com/index.php/paged/3

will still display the same page.

To get around these problem, insert


< ?php query_posts('paged=' . $paged); ?>

before the code block

< ?php if (have_posts()) : ?>
< ?php while (have_posts()) : the_post(); ?>
...
< ?php endwhile; ?>
...
< ?php endif; ?>

The code block varies for every theme. Backup your theme files before doing any editing.

Popularity: 1%

Most Commented Posts

Posted in General, Scripts, Wordpress.

Tagged with , .


2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Jenna says

    Pretty good post. I just found your blog and wanted to say
    that I’ve really liked browsing your posts. Any way
    I’ll be subscribing to your blog and I hope you write again soon!

Continuing the Discussion

  1. Posts about themes as of June 23, 2009 | All About WordPress linked to this post on June 24, 2009

    [...] changed all that and now the user can directly download structured themes that suit WordPress $Paged and Page Navigation – s.pangonilo.com 06/24/2009 Web 2 WordPress themes normally include featured [...]



Some HTML is OK

or, reply to this post via trackback.