• Hi i have a problem with the pagination, it’s displaying when shouldn’t, for example post per page:6, posts:3 = pagination is visible (image)
    I’m using a custom template, and custom archive.php and search.php, the code is like

    (POSTS LOOP)
    wp_numeric_pagination();
    
    ------
    functions.php
    
    function wp_numeric_pagination() {
        global $wp_query;
    
        $big = 999999999;
        $tag = '<div class="pagination">' . PHP_EOL;
        $tag .= paginate_links( array(
                'base'              => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
                'format'            => '?paged=%#%',
                'current'           => max( 1, get_query_var('paged') ),
                'total'             => $wp_query->max_num_pages,
                'prev_next'         => True,
                'prev_text'         => __('<'),
                'next_text'         => __('>'),
            ) ) . PHP_EOL;
        $tag .= '</div>' . PHP_EOL;
        echo $tag;
    }

    I don’t think is a problem with my code, im using it for months on a lot of themes, including twenty fifteen and works perfectly, the paginations gets displayed only when are more than 6 posts per page.

  • The topic ‘Pagination Issues’ is closed to new replies.