I am developing a new theme and I am using several sidebars in this theme. All works fine, but the widgets are not showing up in the theme customizer section. All widgets are working fine under “appearance -> widgets” section but not in “appearance -> customize”. I am using wordpress 3.9.1.

This is how I declared them in functions.php

if(function_exists('register_sidebar'))
 {

    register_sidebar ( array (
            'name' => 'Widget Area 1',
            'id' => 'widget-1',
            'description' => 'Widget Area 2.',
            'before_widget' => '<div id="%2$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h3>',
            'after_title' => '</h3>' ,
    ) );



    register_sidebar ( array (
            'name' => 'Widget Area 2',
            'id' => 'widget-2',
            'description' => 'Widget Area 2.',
            'before_widget' => '<div id="%2$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h3>',
            'after_title' => '</h3>' ,
    ) );


    register_sidebar ( array (
            'name' => 'Widget Area 3',
            'id' => 'widget-3',
            'description' => 'Widget Area 3.',
            'before_widget' => '<div id="%2$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h3>',
            'after_title' => '</h3>' ,
    ) );

    register_sidebar ( array (
            'name' => 'Widget Area 4',
            'id' => 'widget-4',
            'description' => 'Widget Area 4.',
            'before_widget' => '<div id="%2$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h3>',
            'after_title' => '</h3>' ,
    ) );

}

And this is how I call them.

<?php
    if (! function_exists ( 'dynamic_sidebar' ) || ! dynamic_sidebar ( 'Widget Area 1' )) :

endif;?>

It is showing fine when I have one widget area but as soon as I add multiple ones it disappears from customizer.

6 Answers
6

Widgets DO appear in the Customizer, but only if you are on the page that they are used on.

For example, I have a sidebar for the Archive page. When I’m in the Customizer and on the homepage, that sidebar doesn’t appear. But if I navigate to an archive page while in the Customizer, it then appears in the widget area.

Leave a Reply

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