Roots Discourse

Roots with Side Navbar

I had a need for a fixed side navigation bar, so I created this fork and pushed the changes. If anyone has suggestions or improvements, please submit a pull request. I would like to improve it, because I am new to Roots and Wordpress themes.

Roots with Side Navbar on Github

The sidebar can use the Primary Navigation or create a new Menu and use it in the nav bar. This is a basic implementation, allowing for a multitude of changes.

I believe it will help a person new to Roots to show an example of how to add a custom part to the theme. All you have to do is follow the initial commits and see the changes made.

Thanks for sharing this.

You don’t need to create the Roots_SideNavbar class; it unnecessarily duplicates code. Just create a second object with Roots_Sidebar; it’s what the class is there for.

I would also tidy up the roots_main_class() to make it clearer what classes go where, or at least add comments.

1 Like

@Foxaii Thanks for the input! What the heck was I thinking. Well, the good thing is it was as easy to delete the duplicate code as to create it. Late night programming can make you blind, but still not a good excuse for missing it. Good Idea to make sure we know what column is what with some comments.

Roots has me liking PHP and Wordpress a whole lot more. I appreciate all the effort you guys put into Roots. Please don’t fault me for the sloppy first stab.

Note: applied the recommendations