Skip to main content
added 1020 characters in body
Source Link
steakpi
  • 207
  • 2
  • 6

Ok, so I have added the following pagination tags:

<?php next_posts_link( 'Older posts' ); ?>
<?php previous_posts_link( 'Newer posts' ); ?>

I can see in the address bar that the querystring is changing correctly

e.g. localhost:8888/wordpress/?paged=3

However, the page results are staying the same (showing the original first 10 results).

What have I got wrong here?

EDIT:

Here is the code (without any of the HTML):

<!--Latest Post-->
<?php query_posts('posts_per_page=1'); while(have_posts()) : the_post(); ?>
    <?php echo get_avatar( get_the_author_meta( 'ID' ), 125 ); ?>
    <?php the_title(); ?>
    <?php the_time('F jS, Y'); ?>
    <?php the_author(); ?>
    <?php the_excerpt(); ?>
<?php endwhile; wp_reset_query(); ?>    

<!-- Next set of posts to display on page -->
<?php query_posts('posts_per_page=10&offset=1'); while(have_posts()) : the_post(); ?>       
    <?php echo get_avatar( get_the_author_meta( 'ID' ), 125 ); ?>
    <?php the_title(); ?>
    <?php the_time('F jS, Y'); ?>
    <?php the_author(); ?>
    <?php the_excerpt(); ?>
<?php endwhile; wp_reset_query(); ?>

<!--Pagination-->
<?php next_posts_link( 'Older posts' ); ?>
<?php previous_posts_link( 'Newer posts' ); ?>

Hopefully that all looks ok. The page displays nicely, its just the pagination that is not behaving... yet.

Ok, so I have added the following pagination tags:

<?php next_posts_link( 'Older posts' ); ?>
<?php previous_posts_link( 'Newer posts' ); ?>

I can see in the address bar that the querystring is changing correctly

e.g. localhost:8888/wordpress/?paged=3

However, the page results are staying the same (showing the original first 10 results).

What have I got wrong here?

Ok, so I have added the following pagination tags:

<?php next_posts_link( 'Older posts' ); ?>
<?php previous_posts_link( 'Newer posts' ); ?>

I can see in the address bar that the querystring is changing correctly

e.g. localhost:8888/wordpress/?paged=3

However, the page results are staying the same (showing the original first 10 results).

What have I got wrong here?

EDIT:

Here is the code (without any of the HTML):

<!--Latest Post-->
<?php query_posts('posts_per_page=1'); while(have_posts()) : the_post(); ?>
    <?php echo get_avatar( get_the_author_meta( 'ID' ), 125 ); ?>
    <?php the_title(); ?>
    <?php the_time('F jS, Y'); ?>
    <?php the_author(); ?>
    <?php the_excerpt(); ?>
<?php endwhile; wp_reset_query(); ?>    

<!-- Next set of posts to display on page -->
<?php query_posts('posts_per_page=10&offset=1'); while(have_posts()) : the_post(); ?>       
    <?php echo get_avatar( get_the_author_meta( 'ID' ), 125 ); ?>
    <?php the_title(); ?>
    <?php the_time('F jS, Y'); ?>
    <?php the_author(); ?>
    <?php the_excerpt(); ?>
<?php endwhile; wp_reset_query(); ?>

<!--Pagination-->
<?php next_posts_link( 'Older posts' ); ?>
<?php previous_posts_link( 'Newer posts' ); ?>

Hopefully that all looks ok. The page displays nicely, its just the pagination that is not behaving... yet.

Source Link
steakpi
  • 207
  • 2
  • 6

Pagination - not progressing

Ok, so I have added the following pagination tags:

<?php next_posts_link( 'Older posts' ); ?>
<?php previous_posts_link( 'Newer posts' ); ?>

I can see in the address bar that the querystring is changing correctly

e.g. localhost:8888/wordpress/?paged=3

However, the page results are staying the same (showing the original first 10 results).

What have I got wrong here?