How to create pagination on archive.php template

The solution was surprisingly simple as you can see below.

Thanks for your help @Sally CJ and @Tom J Nowell.

<?php get_header(); ?>

<!-- PAGE INTRODUCTION -->
<div class="container">
    <h1 class="page_title"><?php the_archive_title(); ?></h1>
</div>

<!-- PAGE CONTENTS -->
<div class="container">
    <div class="row">

        <!-- POSTS -->
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
            <div class="item">
                <h3 class="subtitle no_margin_bottom"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
                <a href="<?php the_permalink(); ?>">Read more</a>
            </div>
        <?php endwhile; endif; wp_reset_postdata(); ?>

        <!-- PAGINATION -->
        <?php the_posts_pagination(); ?>

    </div>
</div><!-- END OF SECTION -->

<?php get_footer(); ?>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)