Forums

Next and Previous don't work! (9 posts)

  1. Frozzare
    Member
    Posted 4 years ago #

    Hi, when i should ad Next and Previous links, they don't work.

    my index.php pages: where the post will show.

    <div id="content">
    
     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
     <?php if ( in_category('3') ) { ?>
               <div class="post-cat-three">
     <?php } else { ?>
               <div class="post">
     <?php } ?>
    
     <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    
     <small><?php the_time('F jS, Y'); ?></small>
    	<br />
     <div class="entry">
       	<?php the_content(); ?>
     </div>
    
     <p class="postmetadata">Postad i <?php the_category(', '); ?> | <?php the_tags(__('Taggar: '), ', ', ' | '); ?> <?php edit_post_link(__('&Auml;ndra')); ?></p>
     </div>
     <?php endwhile; else: ?>
    
     <p>Ty&auml;rr, det du letar efter finns inte.</p>
    
    	<p><?php next_posts_link('&laquo; Older Entries') ?></p>
    		<p>	<?php previous_posts_link('Newer Entries &raquo;') ?></p>
    
     <?php endif; ?>
          <?php get_footer(); ?>
    </div>
  2. Frozzare
    Member
    Posted 4 years ago #

    Any?

  3. Frozzare
    Member
    Posted 4 years ago #

    Any body how now why it don't work?

  4. Lester Chan
    Member
    Posted 4 years ago #

    Did the prev/next post link work in the default theme in the first place?

  5. Frozzare
    Member
    Posted 4 years ago #

    yes, but not in the theme i working on,

  6. Frozzare
    Member
    Posted 4 years ago #

    i fix it :) the code was on a wrong place ;)

  7. Frozzare
    Member
    Posted 4 years ago #

    now the next/prev is after every post :/

  8. Lester Chan
    Member
    Posted 4 years ago #

    Put the code after the loop, after <?php endwhile; ?>

  9. Frozzare
    Member
    Posted 4 years ago #

    Yeah, it works :) Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic