WordPress.org

Ready to get started?Download WordPress

Forums

Pagination problem moving to next page of blog posts (13 posts)

  1. talia
    Member
    Posted 5 years ago #

    I have a pagination problem with my blog posts.

    The theme is set for 10 posts on the page. When you hit next it says it is on page 2 but repeats the same 10 posts from the first page.

    Can anyone tell me please how this can be fixed?

    This is my index page

    <?php get_header();?>
    <div id="main">
    	<div id="content">
    	    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    			<div class="post" id="post-<?php the_ID(); ?>">
    				<p class="postmeta"><em><?php the_author_posts_link() ?> on <?php the_time('M jS Y') ?> <?php edit_post_link(__('Edit This')); ?></em><?php the_category(',') ?></p>
    				<h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    				  <div class="entry">
    					    <?php the_content(__('Continue Reading »')); ?>
    			        <?php wp_link_pages(); ?>
                  <p class="post-tags">
                    <?php if (function_exists('the_tags')) the_tags('Tags: ', ', ', '<br />'); ?>
                  </p>
    		      </div>
    		      <p class="posted"><span class="comments"><?php comments_popup_link(__('No responses yet'), __('One response so far'), __('% responses so far')); ?></span></p>
    	     </div>
    	     <?php endwhile; else: ?>
             <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    		 <?php endif; ?>
          <p align="center"><?php posts_nav_link(' - ','« Prev','Next »') ?></p>
    	</div>
      <?php get_sidebar();?>
      <?php get_footer();?>
  2. Darran
    Member
    Posted 5 years ago #

    Do you have a demo of the error?

  3. talia
    Member
    Posted 5 years ago #

    the page is protected for members only so i'm not sure how i can demo it unless i take screen shots

    but it says http://whydietsdontworkclubmembers.com/goldmembers/page/2/
    and still only shows the posts on the first page

    i am using a virtual directory for the blog posts. could that be the problem?

  4. Darran
    Member
    Posted 5 years ago #

    By virtual directory, what do you mean?

    If it is an added directory not understood by WordPress, then perhaps that is your fix to the problem.

  5. taygeta
    Member
    Posted 5 years ago #

    I have the same problem. I have 5 posts per page, but when I click "older posts" it reloads the main page. The URL is correct, though.

    It used to work, and I'm not sure when it stopped working or why. It might have stopped working when I altered my loop to exclude one category from the main page. At the top of my loop I have:

    <?php if (is_home()) { query_posts("cat=-6"); } ?>
    	<?php if (have_posts()) : ?>

    This is the only part I changed, and I don't know whether this broke it...
    I've checked it in Firefox, IE, and Safari, and the problem is the same.

    Any ideas?

  6. @mercime
    Volunteer Moderator
    Posted 5 years ago #

    Settings > Permalinks update.

  7. talia
    Member
    Posted 5 years ago #

    the virtual directory is set up in the Settings > Permalinks as mercime says
    but it works fine for categories!

  8. talia
    Member
    Posted 5 years ago #

  9. taygeta
    Member
    Posted 5 years ago #

    I don't think it's a permalinks issue. I use the default permalinks, not pretty permalinks.

  10. talia
    Member
    Posted 5 years ago #

    any other ideas?

  11. Darran
    Member
    Posted 5 years ago #

    I just checked, your category tips only has 2 posts, so technically, there will not be a second page because there are too little posts. Try adding more posts so that the number is more than the number which you set in your options.

  12. talia
    Member
    Posted 5 years ago #

    thinking about it I checked in the http://whydietsdontworkclubmembers.com/goldmembers/category/announcements/call-schedule/ category which has 3 posts, set it to 2 posts per page and it showed the second page

    However, I'm curious. The page is meant to be protected for members only so how were you able to view the tips? Is there a way people can get around the protection?

  13. talia
    Member
    Posted 5 years ago #

    Oh, I see LOL. It shows the headings. Hah! I never knew that.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags