Forums

'posts_nav_link()' issue (3 posts)

  1. dean_k
    Member
    Posted 1 month ago #

    Hi all,
    I'm having an issue with 'posts_nav_link()' on this site:
    http://www.hellobeautifulworld.com/blog/

    Basically, both the 'Next' and 'Previous' links generated link directly back to the same page- i.e. although there are in excess of fifteen posts, the same number, in the same order, always show up on the page. (I've had to remove the link generation code for the moment as the site is live)

    However, the same basic technique work fine for the 'Author' pages:
    http://www.hellobeautifulworld.com/author/simon/

    I have a feeling it may be related to the fact the blog page isn't the index page, OR that the posts are from only one category, does that sound likely?

    Thanks in advance,
    Dean

  2. esmi
    Member
    Posted 1 month ago #

    If you're using query_posts to limit the display to a single category, try using:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'category_name' => 'Foobar',
    	'paged' => $paged
    );
    query_posts($args);
    ?>
  3. dean_k
    Member
    Posted 1 month ago #

    Thanks esmi, I'll try that out.

Reply

You must log in to post.

About this Topic

Tags