Sidebar Generator

Overview

Use this tool to create custom code for Sidebars with register_sidebar() function.

Usage

  • Fill in the user-friendly form.
  • Click the “Update Code” button.
  • Copy the code to your project.
  • Or save it as a snippet and share with the community.

Examples

If you are still learning how to use this tool, check out the following examples:

The function used in the code.
Add Child Themes Support.
Translation file Text Domain. Optional.
ID used in the code. Lowercase, without spaces.
Sidebar CSS class name.
Sidebar name presented in the the dashboard.
Short descriptive summary of the sidebar.
HTML to place before every widget title.
HTML to place after every widget title.
HTML to place before every widget.
HTML to place after every widget.
ID used in the code. Lowercase, without spaces.
Sidebar CSS class name.
Sidebar name presented in the the dashboard.
Short descriptive summary of the sidebar.
HTML to place before every widget title.
HTML to place after every widget title.
HTML to place before every widget.
HTML to place after every widget.
ID used in the code. Lowercase, without spaces.
Sidebar CSS class name.
Sidebar name presented in the the dashboard.
Short descriptive summary of the sidebar.
HTML to place before every widget title.
HTML to place after every widget title.
HTML to place before every widget.
HTML to place after every widget.
ID used in the code. Lowercase, without spaces.
Sidebar CSS class name.
Sidebar name presented in the the dashboard.
Short descriptive summary of the sidebar.
HTML to place before every widget title.
HTML to place after every widget title.
HTML to place before every widget.
HTML to place after every widget.
ID used in the code. Lowercase, without spaces.
Sidebar CSS class name.
Sidebar name presented in the the dashboard.
Short descriptive summary of the sidebar.
HTML to place before every widget title.
HTML to place after every widget title.
HTML to place before every widget.
HTML to place after every widget.
  Save Snippet
// Register Sidebars
function custom_sidebar() {

	$args = array(
		'id'            => 'sidebar-section',
		'name'          => __( 'Secondary Widget Area', 'text_domain' ),
		'description'   => __( 'Section Widgets.', 'text_domain' ),
		'before_title'  => '<h3 class="widget-title">',
		'after_title'   => '</h3>',
		'before_widget' => '<section id="%1$s" class="widget %2$s">',
		'after_widget'  => '</section>',
	);
	register_sidebar( $args );

}
add_action( 'widgets_init', 'custom_sidebar' );