I registered the widget area in my functions.php and they appear in my admin area but when I drag it over to the right hand panel to make changes none of them seem to do anything.

Anyone know what I can do to find a solution to this problem?

The widget in question is WP YouTube Lyte

Edit:

add_action( 'widgets_init', array(&$this,'arphabet_widgets_init'));
function arphabet_widgets_init() {

    register_sidebar( array(
        'name' => 'Home right sidebar',
        'id' => 'home_right_1',
        'before_widget' => '<div>',
        'after_widget' => '</div>',
        'before_title' => '<h2 class="rounded">',
        'after_title' => '</h2>',
    ) );
}

1 Answer
1

It sounds like you’re trying to add a new widget area (dynamic sidebar) to your Theme.

That process has three parts:

  1. Register the dynamic sidebar in functions.php, using register_sidebar():

    function wpse121723_register_sidebars() {
        register_sidebar( array(
            'name' => 'Home right sidebar',
            'id' => 'home_right_1',
            'before_widget' => '<div>',
            'after_widget' => '</div>',
            'before_title' => '<h2 class="rounded">',
            'after_title' => '</h2>',
        ) );
    }
    add_action( 'widgets_init', 'wpse121723_register_sidebars' );
    

    This registers the dynamic sidebar with WordPress, which displays its UI in Appearance -> Widgets in the Admin. The important part here is the id parameter, which you’ll use in the next step:

  2. Output the widget area (dynamic sidebar) in your Theme template, wherever appropriate, using dynamic_sidebar( $id ):

    <?php dymamic_sidebar( 'home_right_1' ); ?>
    

    This actually displays the dynamic sidebar in the template.

  3. Populate the dynamic sidebar, via Appearance -> Widgets in the Admin.

It sounds like you’ve done #1 and #3, but not #2.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *