Learn how to fix the layouts with two sidebars (primary and secondary) in Genesis Framework child themes using code.
Genesis offers 6 possible structures depending on how you combine the content with the primary and secondary sidebars.
In most cases you don’t need all of them. In fact, if you wish, you can add a snippet to Genesis to force it to always show a certain layout.
For example, would you like all the pages on the website to have 2 sidebars?
Here are 3 alternatives:
Code to force layout designs with two sidebars
Depending on which combination you prefer, use one of the following snippets. And remember: whichever one you choose, add it to the end of the functions.php file.
To fix the layout with 2 sidebars on the right, copy this code:
To see this and another 1097 code snippets of this website, login or subscribe here.
To force the design with 2 sidebars on the left, choose this one:
To see this and another 1097 code snippets of this website, login or subscribe here.
And finally, to apply the layout with secondary sidebar on the left and primary sidebar on the right, enter this fragment:
To see this and another 1097 code snippets of this website, login or subscribe here.
You can also do just the opposite, i.e. fix the full width template (no sidebars) as mandatory.
Conclusions
If you want to get all the pages and entries in your Genesis child theme to show a specific design with 2 sidebars (primary and secondary), you only need to use one of these snippets.
Any questions? Let me know in the comments.
And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉