__( 'Primary Widget Area', 'twentyten' ),
'id' => 'primary-widget-area',
'description' => __( 'The primary widget area', 'twentyten' ),
'before_widget' => '
',
'after_widget' => '',
'before_title' => '',
) );
// Area 2, located below the Primary Widget Area in the sidebar. Empty by default.
register_sidebar( array(
'name' => __( 'Secondary Widget Area', 'twentyten' ),
'id' => 'secondary-widget-area',
'description' => __( 'The secondary widget area', 'twentyten' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
) );
add_custom_background();
register_nav_menus( array(
'primary' => __( 'Primary Navigation', 'twentyten' ),
) );
?>
"Welcome Message",
"type" => "title"),
array( "type" => "open"),
array( "name" => "Twitter Username",
"desc" => "Add your Twitter username.",
"id" => $shortname."_username",
"std" => "whyisjake",
"type" => "text"),
array( "name" => "Number of tweets to show",
"desc" => "Add a number 1-100.",
"id" => $shortname."_number",
"std" => "10",
"type" => "text"),
array( "name" => "Disable Twitter Stream?",
"desc" => "Check this box if you would like to DISABLE the Twitter box.",
"id" => $shortname."_twitter_disable",
"type" => "checkbox",
"std" => "false"),
array( "type" => "close")
);
function mytheme_add_admin() {
global $themename, $shortname, $options;
if ( $_GET['page'] == basename(__FILE__) ) {
if ( 'save' == $_REQUEST['action'] ) {
foreach ($options as $value) {
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
foreach ($options as $value) {
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
header("Location: themes.php?page=functions.php&saved=true");
die;
} else if( 'reset' == $_REQUEST['action'] ) {
foreach ($options as $value) {
delete_option( $value['id'] ); }
header("Location: themes.php?page=functions.php&reset=true");
die;
}
}
add_theme_page($themename." Options", "".$themename." Options", 'edit_themes', basename(__FILE__), 'mytheme_admin');
}
function mytheme_admin() {
global $themename, $shortname, $options;
if ( $_REQUEST['saved'] ) echo ''.$themename.' settings saved.
';
if ( $_REQUEST['reset'] ) echo ''.$themename.' settings reset.
';
?>