Firstly just like to say this is a great forum, I have only just started working with Thematic and all the info on here has been great. I am new to PHP but have managed to successfully accomplish everything so far with a bit of copy and pasting and my small amount of common sense!
My question is this:
How do I create multiple widget areas for use in a childtheme_secondary_aside that I created using Chris' code from http://themeshaper.com/forums/topic/something-new-bout-widgetized-areas#post-6660
The different widget areas are then displayed conditionally (this I have managed to acheive)
Currently my code looks like this:
function change_secondary_aside($content) {
$content['Secondary Aside']['function'] = 'childtheme_secondary_aside';
$content['Third Aside Pages'] = array(
'admin_menu_order' => 201,
'args' => array (
'name' => 'Third Aside Pages',
'id' => 'third-aside-pages',
'before_widget' => thematic_before_widget(),
'after_widget' => thematic_after_widget(),
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
),
'action_hook' => 'thematic_secondary_aside',
'function' => 'childtheme_secondary_aside',
'priority' => 10,
);
return $content;
}
add_filter('thematic_widgetized_areas','change_secondary_aside');
function childtheme_secondary_aside() {
if (is_sidebar_active('secondary-aside') && is_sidebar_active('third-aside-pages')) {
echo thematic_before_widget_area('secondary-aside');
if ( is_tree('90')) {
dynamic_sidebar('third-aside-pages');
} elseif (is_tree('100')) {
dynamic_sidebar('fourth-aside-pages');
} else {
dynamic_sidebar('secondary-aside');
}
echo thematic_after_widget_area('secondary-aside');
}
}
and then I have this other function to create the fourth-aside-pages widget
function add_fourth_aside($content) {
$content['Fourth Aside Pages'] = array(
'admin_menu_order' => 202,
'args' => array (
'name' => 'Fourth Aside Pages',
'id' => 'fourth-aside-pages',
'before_widget' => thematic_before_widget(),
'after_widget' => thematic_after_widget(),
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
),
'action_hook' => 'thematic_secondary_aside',
'function' => 'childtheme_secondary_aside',
'priority' => 8,
);
return $content;
}
add_filter('thematic_widgetized_areas', 'add_fourth_aside');
This works but seems ugly and I would imagine that there is a way that I can get change_secondary_aside function to create more than one widget? My guess would be by using an array but I have no idea how the syntax should look. I tried a couple of things having looked at the widgets-extensions.php file but due to my lack of PHP knowledge they didn't work.
Anyone got any advice.
Thanks!