With traditional WordPress themes, the significance of the template hierarchy is front and center.
With Genesis, you’d be forgiven for thinking that the template hierarchy is thrown out the window, because all your customizations go into your child theme functions.
However, that’s not true – you can still use the template hierarchy to your advantage with Genesis.
As an example, you might want to register a custom sidebar to display for single Posts only. In a traditional WordPress theme, you’d consult the template hierarchy and find that you need to create a template named single-post.php.
With Genesis, this is no different – it’s what you put in to the template that’s different.
First, you register the sidebar in your theme functions:
Next, you output the sidebar in your new template single-post.php. The entirety of the template should be as follows:
The trick is to remember the call to
genesis at the end – this is what handles the Loop,
get_footer and all the markup in between that Genesis has saved you from needing to include in your template.
Once you install the code, you can go into your widgets control panel and add widgets – and you’re done.
The result is below:
- How to Load Your Entire Design with Genesis
- How to Use Conditional Tags with Genesis
- How to Register a Custom Sidebar with Genesis
- How to Output a Custom Widget Area with Genesis
Relevant tutorials from the Genesis community.