Md Mehedi Hasan

paginate_links & str_replace

functions.php

function philosophy_pagination(){
    global $wp_query;
    $links=  paginate_links(array(
        'current'=> max(1,get_query_var('paged')),
        'total'=> $wp_query->max_num_pages,
        'type'=> 'list',
        'mid_size'=> 3,
    ));
    $links =  str_replace("page-numbers", "pgn__num", $links);
    $links = str_replace("<ul class='pgn__num'>", "<ul>", $links);
    $links = str_replace("prev pgn__num", "pgn__prev", $links);
    $links = str_replace("next pgn__num", "pgn__next", $links);

    
    echo $links; 
}

use

<div class="row">
    <div class="col-full">
        <nav class="pgn">
            <?php philosophy_pagination(); ?>
        </nav>
    </div>
</div>