Pagination with wp_query()
-
Hi everybody,
I am developing a theme locally, so I don’t have a link right now.
The problem is that my pagination shows, also if not needed: it sends to an empty page number 2. Anyone has ideas about this error?I paste the code
<ul class="normal-articles cf"> <?php $articoli_taccuino = new WP_Query( 'cat=taccuino&posts_per_page=4&paged='.$paged ); while($articoli_taccuino->have_posts()) : $articoli_taccuino->the_post(); ?> <li class="num-2"> <article class="cf"> <figure> <a>"><?php if( has_post_thumbnail()) { the_post_thumbnail('normal'); }?></a> </figure> <section class="text"> <h2><a>"><?php the_title(); ?></a></h2> <?php the_excerpt(); ?> <a>">leggi di più…</a> </section> </article> <?php endwhile; wp_reset_postdata(); ?> <!-- PAGINAZIONE --> <div class="pagination"> <?php global $wp_query; $infinito = 999999999; echo paginate_links( array( 'base' => str_replace( $infinito, '%#%', get_pagenum_link( $infinito ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $wp_query->max_num_pages, 'prev_text' => 'Precedenti |', 'next_text' => '| Successivi' )); ?> </div>
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Pagination with wp_query()’ is closed to new replies.