The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

next/previous posts not working (5 posts)

  1. mrwolfy
    Posted 6 years ago #

    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!


        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(); ?>
    				 <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>
    	<?php endif; ?>
    <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>
    <!--END  CONTENT!-->	
    <div class="push"></div>
    <?php get_footer(); ?>
  2. Peter Boosten
    Posted 6 years ago #

    Hmmm, the url displays http://owolf.com/home/category/art/page/2/
    which seems to be correct.


  3. mrwolfy
    Posted 6 years ago #

    right, but the content is incorrect, ie it is just the same content as the previous page.

  4. Peter Boosten
    Posted 6 years ago #

    On that particular link I get only one post (with this title 'OWOLF 2 | Posted December 7th, 2009 | Category "Art, Painting" '), while the previous page shows five.


  5. mrwolfy
    Posted 6 years ago #

    right, that's correct, because i changed from pages, as the code above will generate, to categories to fix the issue. Categories work perfectly for me.

    thanks for your interest.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.