special template page slightly broken – can’t figure out what’s wrong
-
I have a special template for a page on my site. Basically I want to display 3 posts and have previous and next links so users can scroll through older posts.
It will display three posts, but the previous and next links don’t work. Previous just shows the same three posts.
<?php query_posts('cat=6&showposts=3'); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <ul class="pmeta"> <li>Posted by <?php the_author() ?></li> <li>On <?php the_time('F j, Y') ?></li> <li><br /><?php the_category(', ') ?></li> <?php if (function_exists('the_tags')) { the_tags('<li>Tags ', '</li>'); } ?> <li><br /><?php comments_popup_link('No Comments', '1 Comment', '% Comments' );?></li> <?php edit_post_link('Edit', '<li>', '</li>'); ?> </ul> <div class="apost"> <h2 id="post-<?php the_ID(); ?>"> <?php if (function_exists('get_cat_icon')) get_cat_icon('small=false'); ?><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2> <div class="pmain"> <!-- spost --> <?php the_content('Read more...'); ?> <!-- epost --> </div> <?php if ($count==1) { ?> <!-- PLACE YOUR 468x60 ADSENSE CODE (OR BANNER) BELOW --> <script type="text/javascript"><!-- /* 468x60, created 4/26/08 */ <script type="text/javascript" src="https://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <!-- PLACE YOUR 468x60 ADSENSE CODE (OR BANNER) ABOVE --> <?php } ?> <?php $count = $count + 1; ?> </div> <div class="extra"></div> <?php endwhile; ?> <div class="lead"> <span class="ppre"><?php next_posts_link('« Previous Posts') ?></span> <span class="pnex"><?php previous_posts_link('Next Posts »') ?></span> </div> <?php else : ?> <div class="apost"> <h2 class="subh">Oops!</h2> <p class="nopost">Sorry, but you are looking for something that isn't here.</p> </div> <?php endif; ?> </div> </div>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘special template page slightly broken – can’t figure out what’s wrong’ is closed to new replies.