Skip to content

Snippet: Register A New Custom Sidebar

Important: Total has a built-in function so you can easily add new sidebars via Appearance > Widget Areas. However, if you prefer to use code you can easily add new sidebars like such:

if ( function_exists( 'wpex_register_sidebar' ) ) {
	wpex_register_sidebar( array(
		'id'   => 'my_custom_sidebar',
		'name' => esc_html__( 'My Custom Sidebar Name', 'total' ),
	) );
}
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top