Sidebar Widgets – register_sidebar in functions.php

Sidebar Widgets – register_sidebar in functions.php

Register WordPress Right Sidebar in your functions.php custom template file


function arphabet_widgets_init() {

register_sidebar( array(
‘name’ => ‘Right Sidebar’,
‘id’ => ‘right_sidebar’,
‘before_widget’ => ‘<div>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3>’,
‘after_title’ => ‘</h3>’,
) ); }

add_action( ‘widgets_init’, ‘arphabet_widgets_init’ );


Display the registred sidebar in single.php, page.php, category.php, archive.php, tag.php template files

<?php dynamic_sidebar( ‘right_sidebar’ ); ?>


blockquote