Register Sidebars a Better Way

This is a better way to register your sidebars. The code should look like the one below if you submit your theme to WordPress.org.

Want to add more sidebars?

Copy and Paste the “register_sidebar” code to create more sidebars. Don’t forget to change the ID!


add_action( 'widgets_init', 'theme_register_sidebars' );

function theme_register_sidebars() {

	/* Register the 'sidebar #1' sidebar. */
			'id' => 'sidebar',
			'name' => __( 'Sidebar #1' ),
			'description' => __( 'Sidebar #1' ),
			'before_widget' => '',
			'after_widget' => '',
			'before_title' => '',
			'after_title' => ''
 	// Copy & Paste the "register_sidebar" code to create more sidebars. Don't forget to change the ID!


Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!