Solved

wordpress pagination issues

Posted on 2014-02-14
3
918 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Custom WordPress pages? 4 40
problems with widget background image 9 34
Can't find an open element in HTML 5 51
Last 4 numbers of a variable 9 19
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

737 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