Creating templates within your theme
You've now got a functional basic template for your theme. It works great on the main blog page and successfully loads content for anything you can click on in your site.
However, we want slightly different templates for other types of content on our site. For example, a single post page needs to have a comments form where visitors can post comments; the Page page doesn't need to show the date, category, or tags; and the category page should show the category name.
Before we can create other templates, we need to break up the main
index.php file into parts so that these different templates can share the common elements. I've mentioned many times the importance of the header, sidebar, and footer. We're going ...