1

It's showing widgets.php:

enter image description here

Not showing customizer:

not show customizer

sidebar.php

function footer_sidebar()
{
    register_sidebar(
        array(
            'name' => __( 'Footer Sidebar 1', 'footer1' ), 
            'id' => 'footer1',
            'description' => __( 'Footer Sidebar 1', 'footer1' ),
            'before_widget' => '<div id="footer1" class="col-md-4" style="margin-bottom:10px;margin-top:-25px;">', 
            'after_widget' => '</div>', 
            'before_title' => '<h3>', 
            'after_title' => '</h3>',
        )
    );

    register_sidebar(
        array(
            'name' => __( 'Footer Sidebar 2', 'footer2' ), 
            'id' => 'footer2',
            'description' => __( 'Footer Sidebar 2', 'footer2' ),
            'before_widget' => '<div id="footer2" class="col-md-4" style="margin-bottom:10px;margin-top:-25px;">', 
            'after_widget' => '</div>', 
            'before_title' => '<h3>', 
            'after_title' => '</h3>',
        )
    );
}
add_action( 'widgets_init', 'footer_sidebar' );

footer.php

<div class="row">
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('footer1') ) : ?><?php endif; ?>
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('footer2') ) : ?><?php endif; ?>
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('footer3') ) : ?><?php endif; ?>
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('footer4') ) : ?><?php endif; ?>
</div>
2
  • Have you tried this? Commented Feb 13, 2016 at 18:13
  • Remember to add wp_head() before </header> tag and wp_footer() before </body> tag. It works for but I had the same problem. Commented Jan 4, 2019 at 20:30

2 Answers 2

2

You have to put the function footer_sidebar() in the file functions.php not sidebar.php

Is the footer.php included on site you opened the customizer?

2
  • The IFs in footer.php are not needed as well, although that is probably not the reason for the fail. Commented Feb 12, 2016 at 5:52
  • functions.php: <?php require_once('inc/tool/customizer.php'); require_once('sidebar.php'); ?> sidebar it's working : prntscr.com/a2j8xl Sidebar not showing customizer! Commented Feb 12, 2016 at 23:40
0

You might be forgotten to add wp_footer(); function before the closing body tag in your footer.php. That causes the javascript cannot finish its instruction in the customizer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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