Error 404 when clicking "2"
-
Hi there !
I’m using Wp-pagenavi on a custom loop which display two categories.
My code works well but when i click on next page = page not found…here’s my code :
?php if(is_category('1')) { ?> <?php $paged = intval (get_query_var('paged')); if ($paged == 0) { $paged = 1; } $my_query = new WP_Query( array( 'cat' => '1', 'paged' => $paged, 'posts_per_page' => '5' ) ); while ( $my_query->have_posts() ) : $my_query->the_post(); ?> <?php if (in_category('9')) continue; ?> <div class="actualites"> <h1><?php the_title(); ?></h1> <h2><?php the_date(); ?></h2> <p><?php the_excerpt(); ?></p> <a href="<?php the_permalink() ?>" rel="bookmark"><ul><li>Lire la suite</li></ul></a> </div> <?php endwhile; ?> <div id="nav-below" class="navigation"> <?php wp_pagenavi( array( 'query' => $my_query ) ); ?> </div><!-- #nav-below --> <?php wp_reset_query(); ;} ?> <?php if(is_category('9')) { ?> <?php $paged = intval (get_query_var('paged')); if ($paged == 0) { $paged = 1; } $my_query = new WP_Query( array( 'cat' => '9', 'paged' => $paged, 'posts_per_page' => '5' ) ); while ( $my_query->have_posts() ) : $my_query->the_post(); ?> <?php if (in_category('1')) continue; ?> <div class="actualites"> <h1><?php the_title(); ?></h1> <h2><?php the_date(); ?></h2> <p><?php the_excerpt(); ?></p> <a href="<?php the_permalink() ?>" rel="bookmark"><ul><li>Lire la suite</li></ul></a> </div> <?php endwhile; ?> <div id="nav-below" class="navigation"> <?php wp_pagenavi( array( 'query' => $my_query ) ); ?> </div><!-- #nav-below --> <?php wp_reset_query(); ;} ?>
Can’t find the way to make it works ??
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Error 404 when clicking "2"’ is closed to new replies.