My WordPress pagination works but I’d like to make some ‘minor’ adjustments. I thought I’d be able to find some code I could drop into my functions.php but I can’t find anything that does the job, so I’m hoping for a bit of help.

Basically I want the pagination to always display the prev/next arrows, whichever one isn’t needed has a class of inactive for styling – currently whichever isn’t required isn’t displayed at all. Also, I’d like to know if ‘…’ is added between a range of pages if they exceed a certain amount to prevent the list from getting too long?

Here’s the current code I have in functions.php:

function html5wp_pagination()
{
    global $wp_query;
    $big = 999999999;
    echo paginate_links(array(
        'base' => str_replace($big, '%#%', get_pagenum_link($big)),
        'format' => '?paged=%#%',
        'current' => max(1, get_query_var('paged')),
        'total' => $wp_query->max_num_pages
    ));
}

Hope someone can help. I’m getting there with WordPress/PHP development but somethings still look totally foreign to me!

Read more here: WordPress pagination prev/next arrows


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: