Register widget

PHP
function custom_sidebar() {
  $args = array(
  'id' => 'widget-weather',
  'name' => __( '天氣', 'innews' ),
  'description' => __( '天氣小工具', 'innews' ),
  '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' );

Tags: