Pagination not working
-
Hello,
I am working on the page https://kraftwerkk9.com/news. The pagination is not working in that if you try to go to a new page, it just displays the first page of posts in that category.
I have narrowed the problem down to the use of `<?php
query_posts(‘cat=1’);
?>` in the template file. If I remove that bit, it shows all post and pagination works. How do I display category 1 without the use of query_post?Here is the entirety of the code in that file:
<?php /** * @package WordPress * @subpackage Grid_Focus */ get_header(); ?> <div id="filler" class="fix"> <div id="mainColumn"> <h2 class="page_title">News</h2> <?php query_posts('cat=1'); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div id="post-<?php the_ID(); ?>" class="post"> <div class="postMeta"> <p class="container"> <span class="date"><?php the_time('M j, Y') ?></span> <span class="comments"><?php comments_popup_link('0', '1', '%'); ?></span> </p> </div> <h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title() ?></a></h2> <div class="addthis_toolbox addthis_default_style" style=""> <a class="addthis_button_facebook_send" addthis:url="<?php the_permalink(); ?>" addthis:title="<?php the_title(); ?>" ></a> <a class="addthis_button_tweet" addthis:url="<?php the_permalink(); ?>" addthis:title="<?php the_title(); ?>" tw:via="kraftwerkk9"></a> <a class="addthis_button_google_plusone" g:plusone:annotation="bubble" addthis:url="<?php the_permalink(); ?>" addthis:title="<?php the_title(); ?>"g:plusone:size="medium" ></a> <div class="hide_fb_like"><a class="addthis_button_facebook_like" addthis:url="<?php the_permalink(); ?>" ></a></div> </div> <br clear="all"/> <div class="entry"> <?php the_content('Read the rest of this entry »'); ?> </div> </div> <?php endwhile; ?> <?php else : ?> <div class="post"> <div class="postMeta"> <p class="container"> <span class="date">No Matches</span> </p> </div> <h2>No matching results</h2> <div class="entry"> <p>You seem to have found a mis-linked page or search query with no matching results. Please trying your search again. If you feel that you should be staring at something a little more concrete, feel free to email the author of this site or browse the archives.</p> </div> </div> <?php endif; ?> <?php if(function_exists('wp_paginate')) { wp_paginate(); } ?> </div> <?php get_sidebar(); ?> </div> <?php get_footer(); ?>
- The topic ‘Pagination not working’ is closed to new replies.