A custom page template which has been in use for 3 or 4 years which rendered a custom sidebar has suddenly stopped rendering it. I can't for the life work out what the problem is.
/* functions.php */
/**
* Register Areas sidebars and widgetized areas.
*
*/
function my_widgets_init() {
register_sidebar( array(
'name' => 'My Sidebar',
'id' => 'my_sidebar',
'before_widget' => '<div>',
'after_widget' => '</div><div> </div>',
'before_title' => '<h2 class="rounded">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'my_widgets_init' );
/* wordpress page template file*/
<?php if ( is_active_sidebar( 'my_sidebar' ) ) : ?>
<div>
<?php dynamic_sidebar( 'my_sidebar' ); ?>
</div>
<?php endif; ?>
In the Wordpress dashboard, 3 or 4 widgets are assigned to the area as would be expected. But calling dynamic_sidebar() renders an empty string.
Any ideas?
* UPDATE *
This is the output of the debugging code provided in the first response.
Sidebar ID: new_sidebar ( Active)
Sidebar Found
4 Widgets Found
All Sidebars Widgets:
Array
(
[wp_inactive_widgets] => Array
(
[0] => calendar-4
[1] => rss-3
[2] => em_calendar-4
[3] => recent-posts-2
)
[hca_alert_area] => Array
(
)
[SNIP - other sidebars]
[new_sidebar] => Array
(
[0] => search-2
[1] => nav_menu-2
[2] => em_widget-2
[3] => recent-posts-3
)
[footer-sidebar] => Array
(
[0] => nav_menu-3
)
[array_version] => 3
)
I've spent a crazy amount of time trying to work out the problem. The site uses a no-longer supported version of the Cherry Framework template. I'm reluctant to update the entire theme purely because of this glitch if I can fix it.