previous and next post not working
-
Hi,
i am trying to add a previous and next post link on my page, i have tried many options by reading the wp codex but i don’t seem to make it work.Any help please?
This is my page
<?php /* Template Name: Blog */ get_header(); ?> <div id="content" class="narrowcolumn" role="main"> <?php query_posts("cat=1"); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div id="blog" class="clearfix" > <div <?php post_class("blogpost clearfix") ?> id="post-<?php the_ID(); ?>"> <div class="postImg"> <?php get_the_image( array( 'custom_key' => array( 'medium', 'medium' ), 'default_size' => 'medium' ) ); ?> </div> <div class="postContent"> <h2 class="blogHeading"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <p class="date"><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></p> <div class="entry"> <?php the_content('Read the rest of this entry »'); ?> </div> </div> <p><?php previous_post('%', 'Previous:', 'no'); ?> | <?php next_post('%', 'Next:', 'no'); ?></p> <?php endwhile; ?> <?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php get_search_form(); ?> </div> <?php endif; ?> </div> <?php get_footer(); ?>
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘previous and next post not working’ is closed to new replies.