Learn to create a flexible genre archive template in Breakdance, displaying books by category dynamically for better navigation, SEO, and user experience.
In this lesson, you’ll discover how to craft a dynamic, genre-specific archive template for your author website using Breakdance. By configuring template settings, mapping dynamic data, and utilizing global blocks, you’ll showcase books by genre to help readers navigate your catalog with ease.
We’ve set this template to display for any genre. When anyone clicks links for the Thriller or Cozy Mystery genre on the website Breakdance will use this template to display the results. Because of that we are going to use as much dynamic data as possible starting with the title.
When I use the preview drop down to switch between the Thriller and Cozy Mystery genres you can see the title changes. I don’t need the archive prefix on the title so I’m going to turn that off.
Back when we added the Genre taxonomies I entered a description of each one as well. Here is one of the spots we get to use it.
Just like with the Archive Title the Archive description will pick up which genre is being looked at and display the appropriate description.
Next we want to add all books with the matching genre tag to the archive page.
From the front end of the website I can check what each genre looks like. Switching between Thriller and Cozy Mystery correctly displays all the books categorised as that genre. As more books get added the archive will add pagination numbers to help navigate readers through the books.
But there is something you may not like.
The sort order.
The default query for all post Archives, including custom post archives, is to display the latest books first. You may not mind that but if you do there is currently no way to change it without code.
Let me show you what I mean.
No matter what options I set inside here there is no way to tell the archive to only show books tagged with the currently selected archive. Instead it shows ALL books and that’s not what we want.
Only when I delete the custom query does it go back to the default query and only show the books from the currently selected genre.
It is possible to customise WordPress archive queries with php code but that’s a deep rabbit hole to go down especially as we add more custom post types and taxonomies to the website.
Instead we are going to stick with the no code solution of conditional templates inside breakdance starting with our Series Archives we are going to build next.
You’ve now learned how to build and fine-tune a genre archive template in Breakdance, dynamically displaying books categorized under each genre. By leveraging global blocks, archive titles, and descriptions, you’ve created a more intuitive, SEO-friendly browsing experience. Although the default sort order may require advanced customization for more control, the no-code solution provides an efficient starting point, guiding readers through your growing collection and paving the way for future enhancements.