I am developing a new theme and I am using several sidebars in this theme all works fine but the widgets 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 1.', 'before_widget' => '', 'after_widget' => '', 'before_title' => '
', 'after_title' => '
' , ) );register_sidebar ( array (
'name' => 'Widget Area 2',
'id' => 'topsearch-widget',
'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' => 'topsearch-widget',
'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' => 'topsearch-widget',
'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 called 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.