• Skip to primary navigation
  • Skip to main content
OsomCode

OsomCode

Awesome code tutorials for WordPress and Genesis

  • Subscribe
  • My account
    • Edit profile
    • Favorites
    • Update credit card
  • Login

Force a layout design with 2 sidebars in Genesis Framework

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 847 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 847 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 847 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. 😉

Genesis Framework Layout PHP Sidebar Sidebar content

To leave read and make questions about this code, you can login or register.

  • About OsomCode
  • FAQ
  • Contact

Legal Notice · Privacy Policy · Cookie Policy · Terms and conditions
Copyright © 2023

Lost your password?