Next and Prev post links not working
-
I have a page with a custom loop and I want to have a limit of so many posts on the page and then click to the next page for more posts. The older posts and newer posts show up but the same posts are on the page. It does not grab the older posts. I am working locally on this page right now but here is the code:
</div><!-- /.athlete-name --> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php the_content(); ?> <?php endwhile; endif; ?> <?php $args = array( 'post_type' => 'LatestNews', 'posts_per_page' => '3' ); $the_query = new WP_Query( $args ); wp_reset_postdata(); ?> <div class="row news-intro"> <?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <div class="col-xs-12 col-sm-4"> <div class="productbox"> <div class="imgthumb img-responsive newsbox-photo"> <!-- <img src="img/cscm-generic-news.jpg"> --> <?php the_field( 'news-image' ); ?> </div> <div class="caption news-caption"> <!-- <h3 class="caption-head">Canadian Sport Centre trainers always looking for more</h3> --> <h3 class="caption-head"><a href="<?php the_permalink() ?>"> <?php $thetitle = $post->post_title; /* or you can use get_the_title() */ $getlength = strlen($thetitle); $thelength = 35; echo substr($thetitle, 0, $thelength); if ($getlength > $thelength) echo "..."; ?> </a></h3> <span class="caption-text"><?php the_excerpt(); ?></span> <div class="clearfix"></div> </div> </div> <div class="clearfix"></div> </div> <?php endwhile; endif; ?>
Any help would be greatly appreciated.
Thank you in advance.
Vince
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Next and Prev post links not working’ is closed to new replies.