• Resolved iheartlolcats

    (@iheartlolcats)


    Each of my paginated pages show the same most recent posts as on the homepage, I can’t see my older entries. I did just update wordpress but I’m not sure if that’s why.. here’s my theme file:

    <?php
    /**
     * @package WordPress
     * @subpackage WP_Theme
     */
    
    get_header(); ?>
    <div class="post">
    
    	<?php
    	rewind_posts();
    	query_posts(
    	array (
    		'cat' => 1,
    		//'posts_per_page' => 3,
    		)
    	); // blog
    	?>
    		<h1>Blog</h1>
    		<div class="entry">
    	<?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?><div class="inner-entry">
    	<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    	<small><?php the_time('F jS, Y') ?></small>
    		<?php the_content('...>'); ?>
    		</div>
    		<?php endwhile; ?>
    		<div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div></div>
    	<?php else : ?>
    		<h2>Not Found</h2>
    		<div class="inner-entry">
    			<p>Sorry, but you are looking for something that isn't here.</p>
    		</div>
    	<?php endif; ?>
    </div></div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    (@esmi)

    Try replacing:

    query_posts(
    	array (
    		'cat' => 1,
    		//'posts_per_page' => 3,
    		)
    	);

    with:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'cat' => 1,
    	'paged' => $paged
    );
    query_posts($args);
    Thread Starter iheartlolcats

    (@iheartlolcats)

    Thanks, that along with the wp-pagenavi worked great!

    This helped me too – thanks esmi!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Each paginated page shows the same posts’ is closed to new replies.