Site logo

Archived topic

change pagination on archive page

3 replies · Started by Shami on November 11, 2022

Viewing posts 1–4 of 4

I want to change my pagination on the archive pages to look like this:

Check image

Please tell me how to achieve this.

Hi there,

1. Add this PHP Snippet to increase the number of mid numbers in the pagination:

add_filter( 'generate_pagination_mid_size','tu_increase_pagination_numbers' );
function tu_increase_pagination_numbers() {
    return 3;
}

Change the 3 to the amount you require.

2. Add this PHP Snippet to change the next and previous text:


add_filter( 'generate_next_link_text', function() {
    return 'Next';
} );
add_filter( 'generate_previous_link_text', function() {
    return 'Previous';
} );

3. Add this CSS:


#nav-below .nav-links > *:not(.dots) {
    display: inline-flex;
    justify-content: center;
    margin: 0;
    padding: 0 10px;
    line-height: 40px;
    min-width: 40px;
    border-radius: 6px;
    background-color: #f00;
    color: #000;
}
#nav-below .nav-links > *:not(.dots):hover,
#nav-below .nav-links .current {
    background-color: #00f;
    color: #fff;
}

Thanks for the help.

You're welcome

This archived topic is closed to new replies.