WP-Paginate returning always the same page
-
Hi, I’m totally new at WP but got a freelance with it and don’t understand where is the problem with this issue.
The problem is I need to add a pagination system to this website, I’m trying with WP-Paginate, it seems to be working because is displaying a lot of page’s numbers at the bottom but no matter which one I click it always return the info of the first page, the link changes, but the displayed page is always the same
here is the code:<div class="newsPage"> <?php $query = new WP_Query( 'cat=7&posts_per_page=1' ); ?> <?php while ( $query->have_posts() ) : $query->the_post(); ?> <div class="podcastImage"><a href="<?php the_permalink(); ?>"><img src="/wp-content/themes/mmaoddsbreaker2/images/dynamics-liveOdds/podcast1.png" width="100" height="124"></a></div> <?php endwhile; ?> <section> <!--<img src="/wp-content/themes/mmaoddsbreaker2/images/dynamics-news/newsBg.png" width="419" height="422" align="right" class="newsBG"> --> <h1>News</h1> <p class="specialNewsTitle">The Latest <span>MMA News, MMA Previews</span> & Breaking <span>MMA Odds</span> Information!</p> <div class="article-wrap"> <?php /* Start the Loop */ ?> <?php $is_odd_post = true; ?> <?php $query = new WP_Query( 'cat=3' ); ?> <?php while ( $query->have_posts() ) : $query->the_post(); ?> <article <?php if ($is_odd_post) { ?> class="odd"<?php $is_odd_post = false; } else { $is_odd_post = true; } ?>> <header> <div class="thAligned"> <div class="newsHeadline"> <a href="<?php the_permalink(); ?>"> <?php if(get_the_post_thumbnail()){ echo get_the_post_thumbnail($post_id); }else{ echo get_avatar( get_the_author_meta('ID'), 460 ); } ?> </a> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> </div> </div> <div class="articleDescription"> <?php the_excerpt(); ?> <p class="authorInfo"> By <?php the_author(); ?> / MMAOddsbreaker.com Staff Writer / <?php the_time( "M j, Y" ); ?> </p> </div> </header> </article> <?php endwhile; ?> <?php // if(function_exists('wp_paginate')) {wp_paginate();} ?> <?php // Reset Post Data ?> <?php wp_reset_postdata(); ?> </div> <!--! end of .article-wrap --> <?php include("sideBar.php"); ?> </section> <?php if(function_exists('wp_paginate')) { wp_paginate('range=10&anchor=2&nextpage=Next&previouspage=Previous'); } ?> </div>
Can someone give me an idea about how to fix this?
Thanks in advance.
Juan Luis Ramirez.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘WP-Paginate returning always the same page’ is closed to new replies.