Skip to main content
Tweeted twitter.com/StackWordPress/status/1350774880724250624
Question Protected by Johansson
Retag, better formatting
Source Link
Pieter Goosen
  • 55.4k
  • 23
  • 115
  • 209

widgets Widgets not displaying in theme customizer

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

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>' ,
) );

}

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>' ,
    ) );

}

andAnd this is how I calledcall them.

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.

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

deleted 13 characters in body
Source Link
AKR
  • 41
  • 1
  • 1
  • 4

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' => '

',)); 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>' ,
) );

}

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>' ,
) );

}

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>' ,
) );

}

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>' ,
) );

}

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