1 functions.php
function my_widgets_init() { register_sidebar( array( 'name' => __( 'MyWidgets', 'MyWidgets' ), 'id' => 'my-widgets', 'description' => __( 'Мои виджеты', 'MyWidgets' ), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>', ) ); } add_action( 'widgets_init', 'my_widgets_init' );
2 к примеру, в header.php
<?php if ( is_active_sidebar( 'my-widgets' ) ) { ?> <?php dynamic_sidebar( 'my-widgets' ); ?> <?php } ?>