Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
Wordpress pagination prev/next arrows

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!

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Update Your pagination code like below:

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,
        'show_all' => False,
        'prev_next' => True,
        'prev_text' => __('<'),
        'next_text' => __('>'),
        'type'      => 'list',
        'add_args' => ''
    ));
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!