Tasha
0
Q:

register sidebar wordpress

<?php if ( is_active_sidebar( 'your-sidebar-slug' ) ) { ?>
    <ul id="sidebar">
        <?php dynamic_sidebar('your-sidebar-slug'); ?>
    </ul>
<?php } ?>
0
/**
 * Add a sidebar.
 */
function wpdocs_theme_slug_widgets_init() {
    register_sidebar( array(
        'name'          => __( 'Main Sidebar', 'textdomain' ),
        'id'            => 'sidebar-1',
        'description'   => __( 'Widgets in this area will be shown on all posts and pages.', 'textdomain' ),
        'before_widget' => '<li id="%1$s" class="widget %2$s">',
        'after_widget'  => '</li>',
        'before_title'  => '<h2 class="widgettitle">',
        'after_title'   => '</h2>',
    ) );
}
-1

New to Communities?

Join the community