<?php
/*
 * style one template
*/
?>
<div class="eblog-row eleblog-norma-pagi">
    <div class="eblog-col-lg-12 text-center">
        <?php

        $add_args = [];

        $big = 999999999; 
        $pages = paginate_links( array( 
                'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
                'format'       => '?paged=%#%',
                'current'      => max( 1, get_query_var( 'paged' ) ),
                'total'        => $posts_query->max_num_pages,
                'type'         => 'array',
                'show_all'     => false,
                'end_size'     => 3,
                'mid_size'     => 1,
                'prev_next'    => false,
                'next_text'    => false,
                'add_args'     => $add_args,
                'add_fragment' => ''
             )
        );

        if ( is_array( $pages ) ) {
            $pagination = '<div class="eleblog-pagination"><ul class="pagination pagination-2">';

            foreach ( $pages as $page ) {
               $pagination .= '<li class="page-item '.(strpos($page, 'current') !== false ? 'active' : '').'"> ' . str_replace( 'page-numbers', 'page-link', $page ) . '</li>';
            }

            $pagination .= '</ul></div>';

            echo wp_kses_post( $pagination );

        }

        wp_reset_postdata();
        ?>

    </div>
</div>