waynedunkley
11/25/2015 - 12:45 AM

Create New Sidebars for use to insert Widgets. 1. Add the new sidebar template to your theme - sidebar-my-sidebar.php 2. Register the new s

Create New Sidebars for use to insert Widgets.

  1. Add the new sidebar template to your theme - sidebar-my-sidebar.php
  2. Register the new sidebar in functions.php, this will register the sidebar so that it shows up in your CMS
  3. Insert the sidebar into your theme where you want it to show. You can now add widgets to your side bar from Appearance->Widgets
<?php 
/**
* Create the new sidebar template
*/
if ( is_active_sidebar( 'footer-subscribe' ) ) { ?>

	<aside id="sidebar-footer-subscribe" class="sidebar">

		<div class="container">

		<?php dynamic_sidebar( 'footer-subscribe' ); ?>

		</div><!-- .container -->

	</aside><!-- #sidebar-subsidiary .sidebar .aside -->

<?php } ?>
<?php
/**
* Insert sidebar into template file
*/
get_sidebar( 'footer-subscribe' ); // Inserts sidebar
?>
<?php
/**
* Registers sidebars.
*/
function register_new_sidebars() {

	hybrid_register_sidebar(
		array(
			'id' => 'sidebar-my-sidebar',
			'name' => _x( 'My New Sidebar', 'sidebar', 'hybrid-base' ),
			'description' => __( 'My New sidebar for cool widgets.', hybrid_get_parent_textdomain() )
		)
	);

}
add_action( 'widgets_init', 'register_new_sidebars', 5 );
?>