Solved

wordpress pagination issues

Posted on 2014-02-14
3
923 Views
Last Modified: 2014-03-20
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

0
Comment
Question by:flynny
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Author Comment

by:flynny
ID: 39882088
Hi any chance for a bump on this to find out whats going on?
0
 
LVL 25

Accepted Solution

by:
James Rodgers earned 500 total points
ID: 39890670
pretty sure you are missing "paged" from your args

something like

if ( get_query_var('paged') ) {
					  $paged = get_query_var('paged');
					} elseif ( get_query_var('page') ) {
					  $paged = get_query_var('page');
					} else {
					  $paged = 1;
					}
				
				query_posts("cat=" . implode(',',$arrCategory_ids)."&paged=".$paged) ;

Open in new window

0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question