ericn
ericn

Reputation: 13113

Center or fix width of pagination links

Anyone knows of a way to nicely center or fix width of pagination links? Something like this would be ideal!

At the moment, I am using

str_replace( $big, '%#%', get_pagenum_link( $big ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $wp_query->max_num_pages, 'end_size' => 2, 'mid_size' => 3 ) ); ?>

So, when I'm at first page, my pagination links would like the following: enter image description here then on 4th page enter image description here then on 7th page enter image description here then on 2nd last page enter image description here

In this example, I've made all the pagination links float: left. Had I not done that, the "Next >>" link would be too far on the right side.

Thanks a lot in advance!

Upvotes: 1

Views: 795

Answers (2)

ericn
ericn

Reputation: 13113

Thanks to both @Scott and @shoaib akhunzada. Unfortunately, your suggestions don't work.

I've written some Javascript to dynamically centered the group of the pagination links (which change from time to time) and the width of my page (which is fixed).

Problem is now solved!

Upvotes: 0

shoaib akhunzada
shoaib akhunzada

Reputation: 45

control width frome here not in ".pagination" class remove width there in pagination class

/* ur css */
.side {
    border: medium none;
    float: left;
    padding-left: 2px;
    padding-right: 2px;
    text-align: center;
    width: 30px;     /* change this */

Upvotes: 0

Related Questions