I would like to add a sidebar to this theme. I’m familiar with basic code like <?php get_sidebar('homepage'); ?> but this theme doesn’t use this. It pulls the sidebars into the pages another method that I am unfamiliar with. I think it is doing this through this code <?php do_atomic( 'after_content' );
I’ve created a child theme, and declared the sidebars in the child theme’s functions.php. The sidebars show up in the Widgets area in the Dashboard. I created a custom page that I want the sidebar to display on.
Nope, it does it mostly the normal way, but the template files where it does it are a bit unexpected. For instance, page-template-front.php has a get_sidebar( 'primary' ) call. The secondary sidebar isn’t called from the same template but from footer.php.
Something that may throw you off when trying to disable sidebars is the fact that the full-width page template is made to be without sidebars not by excluding the sidebar template calls (as many themes do) but by disabling them for that specific template via functions.php.
The do_atomic() calls are hooks that you could adress via functions.php to add or filter content. They don’t do the sidebars.
The neater way would probably be to create a custom sidebar-secondary.php (or sidebar-tertiary.php) and to call that only when you need it (removing the generic call from footer.php and avoiding the weird method of disabling it for certain templates via functions.php). That’s what I’m doing anyway.
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘How to add a sidebar to Oxygen Theme’ is closed to new replies.