I want to display titles of all posts of the "News" category at
http://example.com/news. I have setup permalinks as
http://example.com/%category%/%postname%/. I use
archive.php template which, according to WordPress Theme Handbook, is " used when visitors request posts by category".
This is what I have in archive.php
<?php if ( have_posts() ) : ?> <?php the_archive_title(); ?> <?php endif; ?>
It returns not what I want:
What is the correct way to return the list of posts belonging to the "News" category in this example? Is the
archive.php correct template for that?
P.S. I know similar questions have been asked, but answers I've found contain a numerous different ways that seem to be a bit hacky. I'm looking to a correct native way to achieve the desired result.