Link to home
Start Free TrialLog in
Avatar of flynny
flynnyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

wordpress pagination issues

hi all,

I'm trying to paginate posts from a blog. The code I have works however when I click the pagination link to move to another page it is simply listing the first page all the time?

I'm using the default twentyfourteen_paging_nav() code which has not been altered at all.

The link for example for page 2 is /blog/page/2

I assume I am missing something simply here? Do I need to parse and chose the relevant page?

<?php
$args = array( 'posts_per_page' => 4, 'post_type' => 'post', 'post_status'=> 'publish', );
query_posts($args);

if ( have_posts() ) : while ( have_posts() ) : the_post();
?>

<hr/>

<?php the_title( '<h1><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); ?>
<div class="stripe-line-search"></div>
<div style="clear:both"></div>

<div class="entry-summary">
<div style="clear:both;"></div>
<a href="<?php the_permalink(); ?>" class="blog-thumb-image">
<?php the_post_thumbnail( array(120,120) ) ?>
</a>
<?php the_excerpt(); ?>
<a class="main-link" href="<?php echo get_permalink($current_page->ID); ?>">
Find out more</a>
<div style="clear:both;"></div>
</div>
<?php 
endwhile; else:
// No posts.
endif;

twentyfourteen_paging_nav();

wp_reset_query();

?>

Open in new window

Avatar of flynny
flynny
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Hi any chance for a bump on this to find out whats going on?
ASKER CERTIFIED SOLUTION
Avatar of James Rodgers
James Rodgers
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial