How it works...
We started this recipe by creating a custom archive page for books in order to understand the usage of the WordPress loop. Before diving into the details of the WordPress loop, we will take a look at the use of a custom archive file.
Once we register a new post type in WordPress, a single book page and book archive page will be available automatically using the default single.php and archive.php templates of the theme. Therefore, the design will be similar to the normal post design. We have the ability to replace these templates with our own templates to make each post type design unique. In order to do that, we have to create these templates with a custom design and name the files using WordPress naming conventions. In this ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access