WordPress is now using the index.php template file to display every type of web page that's a part of your site. Let's make a new file—one that will be used when viewing the monthly archive, category archive, and tag archive.
To create your archive template, make a copy of index.php and rename it archive.php. Now, navigate to see your monthly archive on the site by clicking on either of the months in the sidebar. At this point, the page you'll see should look exactly like the main listing—the one handled by index.php.
Let's make one change to the archive template. I'd like it to display a message that lets users know what type of archive page they are on. Currently, the archive looks the same as the main index listing, and this isn't the most optimized situation. To fix this, just add the following code the <?php if (have_posts()) : ?> line:
<header class="page-header"> <?php the_archive_title('<h1 class="page-title">', '</h1>'); the_archive_description('<div class="taxonomy-description">', '</div>'); ?> </header>
If I go to see my monthly archive now—or the category/tag archive—I'll get a new heading at the top of the page that lets me know where I am, as shown in the following screenshot: