WordPress.org

Support

Support » Themes and Templates » next/previous posts not working

next/previous posts not working

  • I have got my page working. The page displays posts from one category only. Now my problem is that the next page does not display the next page, rather it displays the same six posts that were displayed on the previous page, while the URL reads:http://owolf.com/home/art/page/2/

    perhaps I am missing something fundamental. And it is not possible to mix the query post style of PHP I have with the next_post_link tag? If you have any insight on this please help!

    Thanks!

    <?php
    /*
        Template Name:  my page template
    
    */
    
    ?>
    
    <?php get_header(); ?>
    
    <div class="contentWrapper">
    
    <div class="push"></div>
    
    <div class="container">
    
    <?php if(have_posts()) : ?><?php query_posts('cat=4'); while (have_posts()) : the_post();?>
    
    				<div class="entry">
    					<?php the_content(); ?>
    				</div>
    
    				 <p class="postmetadata"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?> | </a> Posted <?php the_time('F jS, Y') ?> | Category "<?php the_category(', ') ?>" <?php edit_post_link('| Edit','',''); ?> </p>
    
    	<?php endwhile; ?>
    
    	<?php else: ?>
    
    		<div class="post" id="post-<?php the_ID(); ?>">
    			<h2><?php _e('Not Found'); ?></h2z>
    		</div>
    
    	<?php endif; ?>
    
    </div>
    
    </div>
    
    <div class='navigation'>
      <span class='older'><?php next_posts_link('&laquo; Older Entries') ?></span>
      <span class='newer'><?php previous_posts_link('Newer Entries &raquo;') ?></span>
    </div>
    
    <!--END  CONTENT!-->	
    
    <div class="push"></div>
    
    </div>
    
    <?php get_footer(); ?>
    
    </body>
    </html>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘next/previous posts not working’ is closed to new replies.