Skip to main content
2 of 3
deleted 13 characters in body
AKR
  • 41
  • 1
  • 1
  • 4

widgets not displaying in theme customizer

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 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 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.

AKR
  • 41
  • 1
  • 1
  • 4