Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

188
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda