'Wide',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
}
/* -------------------------------------------------
SEARCH WIDGET
-------------------------------------------------- */
// define the widget
function widget_search() {
global $tag_widget_title;
?>
__("Featured category id (please put only numbers 1, 3, 4 etc)", 'default'),
"id" => $shortname."_featured_cat_id",
"type" => "text",
"std" => "9999"
),
array ( "name" => __("Featured posts", 'default'),
"id" => $shortname."_featured_visibility",
"type" => "select",
"std" => "on",
"options" => array("Show" => "on",
"Hide" => "off"
),
)
);
foreach ($options as $value) {
if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); } }
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'] ); } }
wp_redirect("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", "Theme 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.
';
?>
comment_approved == '0') : ?> .