Wordpress

Sidebars

April 2019

Call register_sidebar() for each sidebar you want to create. # Define the ‘main-sidebar’. add_action( ‘widgets_init’, ‘my_register_sidebars’ ); function my_register_sidebars(){ register_sidebar( array( ‘id’ => ‘main-sidebar’, ‘name’ => __( ‘Main Sidebar’ ), ‘description’ => __( ‘Widgets in this area will be shown on all posts and pages.’ ), ‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’, ‘after_widget’ => ‘</aside>’,