I'm trying to display custom widget, but without success.


// Footer Widget options
function footer_widgets() {

    register_sidebar( array(
        'name' => 'Footer Options "Kontakt" ',
        'id' => 'footer_options',
        'before_widget' => '<div>',
        'after_widget' => '</div>',
        'before_title' => '<h2 class="rounded">',
        'after_title' => '</h2>',
    ) );
add_action( 'widgets_init', 'footer_widgets' );

Inside dashboard I filled it with text, and right now I would like to displayt in footer:

I've tried this solutions, but can't display:

  1. <div class="widgets"> <?php if ( is_active_sidebar( 'footer_widgets' ) ) : ?> <ul id="sidebar"> <?php dynamic_sidebar( 'footer_widgets' ); ?> </ul> <?php endif; ?> </div>

  2. <div class="widgets"> <?php dynamic_sidebar( 'footer_widgets' ); ?> </div>

  3. <div class="widgets"> <?php the_widget('footer_widgets'); ?> </div>

  • You need to use footer_options instead of footer_widgets in 1 and 2. the_widget() is to call specific widget not widget area.
    – Shibi
    Dec 17, 2017 at 16:11

1 Answer 1


As noted by Shibi's comment, you want to use footer_options as your argument to dynamic_sidebar as that is the id you assigned in your code.

Keep in mind, both dynamic_sidebar and is_active_sidebar only check for individual sidebars. If you have multiple sidebars (representing neighboring regions) you need to display in your footer, you may need to perform additional conditional checks (with an OR condition at the top level) and rendering calls in series within your desired footer DOM element(s) like:

<div class="widgets">
    <?php if ( is_active_sidebar( 'footer_widgets' ) || (is_active_sidebar('custom_copyright_region')) : ?>
    <ul id="sidebar">
        <?php if ( is_active_sidebar( 'footer_widgets' )) : ?>
            <div id="footer-region1">
            <?php dynamic_sidebar( 'footer_widgets' ); ?>
        <?php endif; ?>

        <?php if(is_active_sidebar('custom_copyright_region')) :?>
            <div id="footer-region2">
            <?php dynamic_sidebar( 'custom_copyright_region' ); ?>
        <?php endif; ?>
    <?php endif; ?>
  • Use dynamic_sidebar() to render all the widgets associated to the designated sidebar (your custom widget will only appear if it is assigned on the widget's page).
  • Use the_widget() to call and render the widget anywhere in your theme (regardless of if it has been assigned on the widget's page- this technique assumes you've defined default values programmatically for your widget to render) [for instance, one might show a calendar view of all related events underneath an event detail page's main copy].

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.