• I’m working in a project where based on the design developed i have to reach a different pagination look out.

    What i want to achieve is this “<Prev 1/19 Next>”

    This is my code so far`

    
    <nav class= "pagination">
                    <?php
                            echo paginate_links( array(
                                'current' => $paged,
                                'total'   => $newsPost->max_num_pages,
                               
    		'aria_current'       => 'page',
    		'show_all'           => false,
    		'prev_next'          => true,
    		'prev_text'          => __( '&laquo; Prev' ),
    		'next_text'          => __( 'Next &raquo;' ),
    		'end_size'           => 0,
    		'mid_size'           => 0,
    		'type'               => 'plain',
    		
    		
                            ));
                          
                        ?> 
                    </nav>
    

    So the previous and next button to show all the time, and in the middle the active page / total number of pages.

    Thanks

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    End size has to be at least 1 or WP will ignore it. Mid size has to be at least 1 or the current mid page number will not display. You can achieve the 1/19 format by adding 'after_page_number' => '/'.$newsPost->max_num_pages, to the args array.

    The problem remaining is the function displays 1 adjacent page number either side of current. There’s no arg available to suppress this. You’d need to use the ‘paginate_links_output’ filter and string manipulation functions to remove any page numbers besides the current from the output string.

Viewing 1 replies (of 1 total)
  • The topic ‘Create a different pagination’ is closed to new replies.