Enpty page pagination
-
Hello i have a problem with my pagination. When i try to visit my second page, it is blank, not even header or footer. Someone have an idea ?
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'post_type' => 'post', 'posts_per_page' => 3, 'paged' => $paged, 'orderby' => 'date', 'order' => 'DESC' ); $query = new WP_Query( $args ); if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); // Afficher les articles ici ?> <article> // my article code </article> <?php endwhile; ?> <!-- Pagination --> <div class="pagination"> <?php echo paginate_links( array( 'total' => $query->max_num_pages, 'prev_text' => __( '«', 'text-domain' ), 'next_text' => __( '»', 'text-domain' ), 'mid_size' => 1 ) ); ?> </div> <?php // Réinitialiser la requête principale wp_reset_postdata(); else : // Aucun article trouvé endif; ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Enpty page pagination’ is closed to new replies.