Skip to content

Instantly share code, notes, and snippets.

@oguzhanozcelik
Last active September 14, 2018 22:25
Show Gist options
  • Save oguzhanozcelik/8677f69acfa2e46fe10d1a413c7045f2 to your computer and use it in GitHub Desktop.
Save oguzhanozcelik/8677f69acfa2e46fe10d1a413c7045f2 to your computer and use it in GitHub Desktop.
Wordpress Dinamik Sidebar Ekleme
function wpb_widgets_init() {
register_sidebar( array(
'name' => __( 'Main Sidebar', 'wpb' ),
'id' => 'sidebar-1',
'description' => __( 'The main sidebar appears on the right on each page except the front page template', 'wpb' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' =>__( 'Front page sidebar', 'wpb'),
'id' => 'sidebar-2',
'description' => __( 'Appears on the static front page template', 'wpb' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'wpb_widgets_init' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment