array( 'search', 'pages', 'categories', 'archives' ),
'secondary-aside' => array( 'links', 'RSS Links', 'meta' )
);
if ( isset( $_GET['activated'] ) ) {
update_option( 'sidebars_widgets', $preset_widgets );
}
// Check for static widgets in widget-ready areas
function is_sidebar_active( $index ){
global $wp_registered_sidebars;
$widgetcolums = wp_get_sidebars_widgets();
if ($widgetcolums[$index]) return true;
return false;
}
function thematic_before_title() {
$content = "
\n";
return apply_filters('thematic_after_title', $content);
}
// Widget: Thematic Search
function widget_thematic_search($args) {
extract($args);
if ( empty($title) )
$title = __('Search', 'thematic');
?>
'Primary Aside',
'id' => 'primary-aside',
'before_widget' => '',
'after_widget' => "",
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
));
// Area 2
register_sidebar(array(
'name' => 'Secondary Aside',
'id' => 'secondary-aside',
'before_widget' => '',
'after_widget' => "",
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
));
// Area 3
register_sidebar(array(
'name' => '1st Subsidiary Aside',
'id' => '1st-subsidiary-aside',
'before_widget' => '',
'after_widget' => "",
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
));
// Area 4
register_sidebar(array(
'name' => '2nd Subsidiary Aside',
'id' => '2nd-subsidiary-aside',
'before_widget' => '',
'after_widget' => "",
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
));
// Area 5
register_sidebar(array(
'name' => '3rd Subsidiary Aside',
'id' => '3rd-subsidiary-aside',
'before_widget' => '',
'after_widget' => "",
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
));
// Area 6
register_sidebar(array(
'name' => 'Index Top',
'id' => 'index-top',
'before_widget' => '',
'after_widget' => "",
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
));
// Area 7
register_sidebar(array(
'name' => 'Index Insert',
'id' => 'index-insert',
'before_widget' => '',
'after_widget' => "",
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
));
// Area 8
register_sidebar(array(
'name' => 'Index Bottom',
'id' => 'index-bottom',
'before_widget' => '',
'after_widget' => "",
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
));
// Area 9
register_sidebar(array(
'name' => 'Single Top',
'id' => 'single-top',
'before_widget' => '',
'after_widget' => "",
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
));
// Area 10
register_sidebar(array(
'name' => 'Single Insert',
'id' => 'single-insert',
'before_widget' => '',
'after_widget' => "",
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
));
// Area 11
register_sidebar(array(
'name' => 'Single Bottom',
'id' => 'single-bottom',
'before_widget' => '',
'after_widget' => "",
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
));
// Area 12
register_sidebar(array(
'name' => 'Page Top',
'id' => 'page-top',
'before_widget' => '',
'after_widget' => "",
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
));
// Area 13
register_sidebar(array(
'name' => 'Page Bottom',
'id' => 'page-bottom',
'before_widget' => '',
'after_widget' => "",
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
));
// we will check for a Thematic widgets directory and and add and activate additional widgets
// Thanks to Joern Kretzschmar
$widgets_dir = @ dir(ABSPATH . '/wp-content/themes/' . get_template() . '/widgets');
if ($widgets_dir) {
while(($widgetFile = $widgets_dir->read()) !== false) {
if (!preg_match('|^\.+$|', $widgetFile) && preg_match('|\.php$|', $widgetFile))
include(ABSPATH . '/wp-content/themes/' . get_template() . '/widgets/' . $widgetFile);
}
}
// we will check for the child themes widgets directory and add and activate additional widgets
// Thanks to Joern Kretzschmar
$widgets_dir = @ dir(ABSPATH . '/wp-content/themes/' . get_stylesheet() . '/widgets');
if ((TEMPLATENAME != THEMENAME) && ($widgets_dir)) {
while(($widgetFile = $widgets_dir->read()) !== false) {
if (!preg_match('|^\.+$|', $widgetFile) && preg_match('|\.php$|', $widgetFile))
include(ABSPATH . '/wp-content/themes/' . get_stylesheet() . '/widgets/' . $widgetFile);
}
}
// Finished intializing Widgets plugin, now let's load the thematic default widgets
register_sidebar_widget(__('Search', 'thematic'), 'widget_thematic_search', null, 'search');
unregister_widget_control('search');
register_sidebar_widget(__('Meta', 'thematic'), 'widget_thematic_meta', null, 'meta');
unregister_widget_control('meta');
register_sidebar_widget(array(__('RSS Links', 'thematic'), 'widgets'), 'widget_thematic_rsslinks');
register_widget_control(array(__('RSS Links', 'thematic'), 'widgets'), 'widget_thematic_rsslinks_control', 300, 90);
}
// Runs our code at the end to check that everything needed has loaded
add_action( 'init', 'thematic_widgets_init' );
?>