Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter BakekaIncontritalia

    (@bakekaincontritalia)

    Is correct add this function? Only this?

    /**
    * 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’ => ”,
    ‘before_title’ => ‘<h2 class=”widgettitle”>’,
    ‘after_title’ => ‘</h2>’,
    ) );
    }
    add_action( ‘widgets_init’, ‘wpdocs_theme_slug_widgets_init’ );

    Moderator James Huff

    (@macmanx)

    Closing in favor of answered duplicate: https://wordpress.org/support/topic/sidebar-136

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘register_sidebar()’ is closed to new replies.