Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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>',
    ) );
}
share|improve this question
    
Show us the code of the template that is running the widget area. As well as the accompanying registration code. –  GhostToast Nov 8 '13 at 20:24
    
This question is unanswerable without seeing your actual code. –  Chip Bennett Nov 8 '13 at 20:26
    
I've added the registration code, but what do you mean by the template code? –  UzumakiDev Nov 8 '13 at 20:28
1  
That code registers a dynamic sidebar area. It's one of three parts of potential code: 1) registering the sidebar area (which you have here), 2) Outputting the sidebar area in the template (via dynamic_sidebar() call), and 3) Defining custom widgets (if applicable). –  Chip Bennett Nov 8 '13 at 20:30
    
Ah....... that would be the problem. –  UzumakiDev Nov 8 '13 at 20:32
show 2 more comments

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
I seemed to have completely glossed over a lot of what actually was involved in using widgets, I basically assumed I just had to activate it and then it would automagically work. The widget I want to use is called WP YouTube Lyte. –  UzumakiDev Nov 8 '13 at 20:49
1  
You should be able to add any given Widget to any given Widget area (dynamic sidebar). –  Chip Bennett Nov 8 '13 at 20:50
    
I'm with it now :D it's working, thank you for your time. –  UzumakiDev Nov 8 '13 at 20:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.