next page posts link keeps duplicating
-
hi,
here is my site. https://www.lateboots.com/blog
the next page keeps duplicating itself. How do i get it to show once at the bottom?
Viewing 4 replies - 1 through 4 (of 4 total)
-
Have a look at your theme’s index.php file and see if it contains a reference to
query_posts()
. If it does, post that code snippet here. It will need some editing.hi, here is whats in my home.php which is my index im told.
while ($the_query->have_posts()) : $the_query->the_post(); $do_not_duplicate = $post->ID; ?>
<?php get_header(); ?> <div id="topbanner" class="column span-14"> <!-- start top banner --> <div class="pagetitle"> // the affair </div> </div> <!-- end top banner --> <?php $marker=0; ?> <div id="home_content" class="column span-14"> <!-- start home_content --> <div id="home_left" class="column span-7 first"> <!-- start home_left --> <?php $catid = $wpdb->get_var("SELECT term_ID FROM $wpdb->terms WHERE name='Asides'"); ?> <?php $catid2 = $wpdb->get_var("SELECT term_ID FROM $wpdb->terms WHERE name='Featured'"); ?> <?php $the_query = new WP_Query('cat=-' .$catid. '&showposts=10&orderby=post_date&order=desc'); while ($the_query->have_posts()) : $the_query->the_post(); $do_not_duplicate = $post->ID; ?> <?php if($marker==0) { $marker=1; ?> <h3 class="mast">The Itinerary For December 2009</h3> <?php ; } ?> <div id="latest_post"> <!-- start latest_post --> <h3 class="latest_post_title" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3> <?php if ( get_post_meta($post->ID, 'latest_home_img', true) ) { ?> <div id="latest_post_image"> <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/latest/<?php echo get_post_meta($post->ID, "latest_home_img", $single = true); ?>" alt="<?php bloginfo('name'); ?>: Latest post" width="470" height="420" /></a> </div> <?php } ?> <p><?php echo strip_tags(get_the_excerpt(), '<a><strong>'); ?></p> <div class="latest_post_meta"> <span class="latest_read_on"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Continue Reading</a></span> <span class="latest_comments"><?php comments_popup_link('Post a comment', 'One comment', '% comments', 'Comments off' ); ?></span> <?php $cat = get_the_category(); $cat = $cat[0]; ?> <span class="latest_category"><a href="<?php echo get_category_link($cat->cat_ID);?>"><?php echo $cat->cat_name; ?></a></span> </div> </div> <!-- end latest_post --> <div class="navigation"> <?php previous_posts_link(); $do_not_duplicate ?> <?php next_posts_link(); $do_not_duplicate ?> </div> <?php endwhile; ?> </div> <!-- end home_left --> <div id="home_right" class="column span-7 last"> <div class="column span-4 first"> <h3 class="mast">Luggage Pick Up</h3> <?php $the_query = new WP_Query('cat=-' .$catid. '&showposts=5&offset=1&orderby=post_date&order=desc'); while ($the_query->have_posts()) : $the_query->the_post(); $do_not_duplicate = $post->ID; ?> <div class="home_recent_post"> <?php if ( get_post_meta($post->ID, 'thumb_home_img', true) ) { ?> <div class="home_recent_thumb"> <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/thumbs/<?php echo get_post_meta($post->ID, "thumb_home_img", $single = true); ?>" alt="<?php the_title(); ?>" /></a> </div> <?php } else { ?> <div class="home_recent_thumb"> <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php if (function_exists('the_thumb')) { the_thumb('altappend=recent_&subfolder=recent&width=75&height=75&keepratio=0'); } ?></a> </div> <?php } ?> <div class="home_recent_title" id="post-<?php the_ID(); ?>"> <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a> </div> <div class="home_recent_date"> <?php the_time('F j, Y'); ?> </div> <div class="home_recent_auth"> By <?php the_author(); ?> </div> </div> <?php endwhile; ?> <?php include('ad_home.php'); ?> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('MiddleColumn') ) : ?> <div id="side_tag_cloud"> <h3 class="mast">Browse</h3> <?php wp_tag_cloud(''); ?> </div> <?php endif; ?> </div> <?php get_sidebar(); ?> </div> </div> <!-- end home_content --> <?php get_footer(); ?>
Try replacing:
<?php $the_query = new WP_Query('cat=-' .$catid. '&showposts=10&orderby=post_date&order=desc');
with:
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $the_query = new WP_Query('cat=-' .$catid. '&showposts=10&orderby=post_date&order=desc&paged='.$paged);
Hi Esmi,
I tried that and it doesn’t work. It still shows exactly the same. Any other ideas about how I can fix this?
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘next page posts link keeps duplicating’ is closed to new replies.