Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other How to reverse pagination – WordPress

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #251438
    amidigital
    Participant

    The code below outputs pages such as

    1 2 3 4 5

    With most recent post being on page 1

    I would like it to look like

    5 4 3 2 1

    With most recent post on page 5

    Thank you!

       <?php $args = array(
        'base'               => '%_%',
        'format'             => '?paged=%#%',
        'current'            => 0,
        'show_all'           => true,
        'end_size'           => false,
        'mid_size'           => false,
        'prev_next'          => true,
        'prev_text'          => __('« Previous'),
        'next_text'          => __('Next »'),
        'type'               => 'plain',
        'add_args'           => false,
        'add_fragment'       => '',
        'before_page_number' => '',
        'after_page_number'  => ''
    ); ?> 
    
        <?php echo paginate_links( $args ); ?>
    
Viewing 1 post (of 1 total)
  • The forum ‘Other’ is closed to new topics and replies.