• I’m inserting a widget area (on a hook) on a page like so:

    function themeblvd_custom_header_addon_content() {
    	if(is_active_sidebar('header-sidebar')){ ?>
    	<div class="jma-header-right">
    		<?php dynamic_sidebar('header-sidebar')   ?>
    	</div>
    	<?php }
    }
    add_action( 'themeblvd_header_addon', 'themeblvd_custom_header_addon_content' );

    registering the widget area like so:

    register_sidebar(array(
                'name' => 'header sidebar',
                'id' => 'header-sidebar',
                'description' => 'This is the widget area for the header',
                'before_widget' => '<div class="widget %2$s" id="%1$s">',
                'after_widget' => '</div>',
                'before_title' => '<h3>',
                'after_title' => '</h3>'
                ));

    When the widget area contains a widget I still get no display. The widget does display if I remove the condition.
    Am I mis-understanding this function. I expect that when a widget is “dragged” into the widget area the widget area is “active” and this function should return TRUE.

The topic ‘is_active_sidebar() always returns false’ is closed to new replies.