Pagination don’t list all entries on Index.php
-
Pagination works perfect on pages but not on the Index.php
Problem: It doesn’t list all entries and the Count for Entries beyond settings >> reading interferes. Depending from what I setting the Count, Entries missing or it list too much empty pages in the Pagination-list at the end…
This is what I did:<?php if ( get_query_var( 'paged' ) ) { $paged = get_query_var( 'paged' ); } elseif ( get_query_var( 'page' ) ) { $paged = get_query_var( 'page' ); } else { $paged = 1; } $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $args = array( 'numberposts' => 4 , 'category_name'=> 'Allgemein', 'post_status' => 'publish, future', 'order'=> 'DEC', 'orderby'=> 'date', 'paged'=> $paged ); $the_query = new WP_Query( $args ); $myposts = get_posts( $args ); foreach ($myposts as $post) : setup_postdata($post);?> <?php the_content(); ?> <?php endforeach; ?> <div><?php the_posts_pagination( array( 'mid_size' => 4, 'prev_text' => __( '←', 'textdomain' ), 'next_text' => __( '→', 'textdomain' ), ) ); ?></div>
Thanks for any help & solution
PS:
The post_status future will be shown by using a function “show_future_posts”, as I want to have an Entry always first.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Pagination don’t list all entries on Index.php’ is closed to new replies.