previous_post_link not working
-
The website: http://providencedailydose.com
I have two loops on the main the first use wp_query to display one post from a certain category and main loop uses query_post to display the rest of the post excluding the category from the first loop.loop 1:
<?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; ?> <?php if (have_posts()) : ?> <?php //query_posts('paged='.$paged); $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query('category_name=featured&showposts=1'.'&paged='.$paged); ?> <?php while (have_posts()) : the_post(); ?> <div id="feature"> <div id="feature-ad"><img src="<?php bloginfo('template_directory');?>/images/728x90_ad.png" alt="728x90 banner ad" width="728" height="90" name="728x90" /></div> <div class="post" id="post-<?php the_ID(); ?>"> <p class="cats"> <?php $category = get_the_category(); ?> filed under: <a href="/topics/<?php echo $category[0]->category_nicename; ?>/" name="<?php echo $category[0]->cat_name; ?>"><?php echo $category[0]->cat_name; ?></a> | <a href="/topics/<?php echo $category[1]->category_nicename; ?>/" name="<?php echo $category[1]->cat_name; ?>"><?php echo $category[1]->cat_name; ?></a></p> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> <?php the_title(); ?> </a></h2> <p class="date-stamp"> <?php the_time('gA') ?> ON <?php the_time ('d/m/Y') ?> <br /> BY <?php the_author_posts_link(); ?> </p> <div class="entry"> <?php the_content('<span class="more-link">more »</span>'); ?> </div> <p class="postmetadata"> <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('leave a comment on this post »', 'one comment »', '% comments »'); ?> </p> </div> </div> <?php endwhile; ?> <?php endif; ?> <?php $wp_query = null; $wp_query = $temp;?>loop 2:
<?php if (have_posts()) : ?> <?php query_posts('cat=-2032'); ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <p class="cats"> <?php $category = get_the_category(); ?> filed under: <a href="/topics/<?php echo $category[0]->category_nicename; ?>/" name="<?php echo $category[0]->cat_name; ?>"><?php echo $category[0]->cat_name; ?></a> | <a href="/topics/<?php echo $category[1]->category_nicename; ?>/" name="<?php echo $category[1]->cat_name; ?>"><?php echo $category[1]->cat_name; ?></a></p> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> <?php the_title(); ?> </a></h2> <p class="date-stamp"> <?php the_time('gA') ?> ON <?php the_time ('d/m/Y') ?> <br /> BY <?php the_author_posts_link(); ?> </p> <div class="entry"> <?php the_content('<span class="more-link">more »</span>'); ?> </div> <p class="postmetadata"> <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('leave a comment on this post »', 'one comment »', '% comments »'); ?> </p> <hr /> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"> <?php next_posts_link('« Older Entries') ?> </div> <div class="alignright"> <?php previous_posts_link('Newer Entries »') ?> </div> </div> <?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?> <?php endif; ?>the previous_posts_link shows up but just displays the same posts as on the home page.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘previous_post_link not working’ is closed to new replies.