the archive.php file is used to display the date, month or year wise and it also used to show the category wise posts, now in this archive template development we are going to learn to make an archive and custom archive page.
Now Start to make the archive page step by step
Step 1
make an archive.php file inside your WordPress custom theme folder, if you want to show custom archive then make archive-
Step 2
get an HTML template to show the archive loop and copy the HTML code and paste into your archive.php file or in the custom archive file.
Step 3
Now place the custom theme header, footer, and sidebar in its position using the code ,
, and
Step 4
Make the archive page title dynamic using the code
Step 5
In archive.php or in custom archive file WordPress is used to send only the post loop related to the searched archive so replace the archive post loop by
Step 6
Now reset the wp-query using the code
Step 7
Now here is the full code to make an archive page
now test the archive page and its ready for use to show the archive post in your WordPress theme