paginate_links() function returns unordered list with class named “page-numbers”. How can I change this class?

EDIT

Currently, I am using the band-aid method below.

$return = paginate_links( $arg );
echo str_replace( "<ul class="page-numbers">", '<ul class="pagination">', $return );

Is there any better way?

4

paginate_links() doesn’t offer a parameter and there are no hooks – see source – available to change the class(es). Which means you can do it like you have done it or you create your own pagination function based on paginate_links().

Leave a Reply

Your email address will not be published. Required fields are marked *