',
'after_widget' => '',
'before_title' => '',
) );
// Area 2
register_sidebar( array (
'name' => 'Secondary Widget Area',
'id' => 'secondary_widget_area',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
) );
} // end theme_widgets_init
add_action( 'init', 'theme_widgets_init' );
$preset_widgets = array (
'primary_widget_area' => array( 'search', 'pages', 'categories', 'archives' ),
'secondary_widget_area' => array( 'links', 'meta' )
);
if ( isset( $_GET['activated'] ) ) {
update_option( 'sidebars_widgets', $preset_widgets );
}
// update_option( 'sidebars_widgets', NULL );
// 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;
} // end is_sidebar_active
// Set content width value based on the theme's design
if ( ! isset( $content_width ) )
$content_width = 900;
// Register Theme Features
function custom_theme_features() {
global $wp_version;
// Add theme support for Automatic Feed Links
if ( version_compare( $wp_version, '3.0', '>=' ) ) :
add_theme_support( 'automatic-feed-links' );
endif;
// Add theme support for Post Formats
$formats = array( 'status', 'quote', 'gallery', 'image', 'video', 'audio', 'link', 'aside', 'chat', );
add_theme_support( 'post-formats', $formats );
add_theme_support( 'get_post-formats', $formats );
add_theme_support( 'has_post-formats', $formats );
// Add theme support for Featured Images
add_theme_support( 'post-thumbnails' );
// Set custom thumbnail dimensions
set_post_thumbnail_size( 300, 300, true );
// Add theme support for Semantic Markup
$markup = array( );
add_theme_support( 'html5', $markup );
}
// Hook into the 'after_setup_theme' action
add_action( 'after_setup_theme', 'custom_theme_features' );
add_filter('body_class','browser_body_class');
function browser_body_class($classes) {
global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;
if($is_lynx) $classes[] = 'lynx';
elseif($is_gecko) $classes[] = 'gecko';
elseif($is_opera) $classes[] = 'opera';
elseif($is_NS4) $classes[] = 'ns4';
elseif($is_safari) $classes[] = 'safari';
elseif($is_chrome) $classes[] = 'chrome';
elseif($is_IE) $classes[] = 'ie';
else $classes[] = 'unknown';
if($is_iphone) $classes[] = 'iphone';
return $classes;
}