siyahsut Kodun tamamı aşağıdaki gibidir.

/*--------------------------------admin panel theme options--------------------------------------*/
$themename = "WallPaper";
//$shortname = "st";
$shortname = str_replace(' ', '_', strtolower($themename));

function get_theme_option($option)
{
global $shortname;
return stripslashes(get_option($shortname . '_' . $option));
}
$categories = get_categories('hide_empty=0&orderby=name');
$wp_cats = array();
foreach ($categories as $category_list ) {
$wp_cats[$category_list->cat_ID] = $category_list->slug;
}

array_unshift($wp_cats, "Choose a category");
$options = array (

array( "name" => $themename." Options",
"type" => "title"),


array( "name" => "General",

"type" => "section"),

array( "type" => "open"),



array( "name" => "Logo URL ( Big Screen )",

"desc" => "Enter the link to your logo image ( size: 550x95px wide ) for big screens",

"id" => $shortname."_logo",

"type" => "text",

"std" => get_bloginfo('template_url') . "/images/logo.png") ,

array( "name" => "Custom Favicon",
"desc" => "A favicon is a 16x16 pixel icon that represents your site; paste the URL to a .ico image that you want to use as the image",
"id" => $shortname."_favicon",
"type" => "text",
"std" => get_bloginfo('template_url') . "/images/favicon.ico"),
array( "type" => "close"),


array( "name" => "Ads Managers",

"type" => "section"),

array( "type" => "open"),



array( "name" => "Header Ad",

"desc" => "Copy Paste 728x90px Adsense code",

"id" => $shortname."_google_header_ads",

"type" => "textarea",

"std" => ""),

array( "name" => "Left Ads",

"desc" => "Copy Paste 160x600px Adsense code-will be visible on Single page",

"id" => $shortname."_google_left_ads",

"type" => "textarea",

"std" => ""),

array( "name" => "right Ads",

"desc" => "Copy Paste 160x600px Adsense code-will be visible on Single page at right hand side",

"id" => $shortname."_google_right_ads",

"type" => "textarea",

"std" => ""),

array( "name" => "Header Text Ad",

"desc" => "Copy Paste 728x15px Adsense code Below -Menu Bar",

"id" => $shortname."_google_header_test_ads",

"type" => "textarea",

"std" => ""),



array( "name" => "After Description Code Unit",

"desc" => "Copy Paste 486x15px Text Adsense code",

"id" => $shortname."_google_after_description",

"type" => "textarea",

"std" => ""),



array( "name" => "Footer Ad Unit",

"desc" => "Copy Paste 728x90px Adsense code",

"id" => $shortname."_google_footer_ad",

"type" => "textarea",

"std" => ""),

array( "name" => "Responsive Ad Unit",

"desc" => "Copy Paste 300x250px Adsense code",

"id" => $shortname."_google_responsive",

"type" => "textarea",

"std" => ""),


array( "type" => "close"),



array( "name" => "Social Media",
"type" => "section"),
array( "type" => "open"),

array( "name" => "Twitter",
"desc" => "Enter the link of your twitter profile page.",
"id" => $shortname."_twitter",
"type" => "text",
"std" => "http://www.twitter.com/notebinary"),

array( "name" => "facebook",
"desc" => "Enter the link of your facebook page.",
"id" => $shortname."_facebook",
"type" => "text",
"std" => "https://www.facebook.com/pages/Binarynote/105116389532030?ref=hl"),

array( "name" => "Google Plus",
"desc" => "Enter the link of your Google Plus Profile page.",
"id" => $shortname."_googleplus",
"type" => "text",
"std" => "https://plus.google.com/u/0/110153835323129101099/posts"),

array( "name" => "Pinterest Profile",

"desc" => "Enter the link of your Pinterest Profile page.",

"id" => $shortname."_pinterest",

"type" => "text",

"std" => "http://www.pinterest.com/kumarrakesh/"),



array( "name" => "Flickr Profile",

"desc" => "Enter the link of your Flickr Profile page.",

"id" => $shortname."_flickr",

"type" => "text",

"std" => "http://www.flickr.com/photos/93583773@N03/"),

array( "name" => "Email Subscription Message for Feedburner",

"desc" => "Enter Email Subscription Message for your Subscriber.",

"id" => $shortname."_feedburner_msg",

"type" => "textarea",

"std" => ""),

array( "name" => "Feedburner URL",

"desc" => "Feedburner is a Google service that takes care of your RSS feed. Paste your Feedburner URL here to let readers see it in your website",

"id" => $shortname."_feedburner",

"type" => "text",

"std" => get_bloginfo('rss2_url')),

array( "type" => "close"),



array( "name" => "Footer",

"type" => "section"),

array( "type" => "open"),



array( "name" => "Footer copyright text",

"desc" => "Enter text used in the right side of the footer. It can be HTML",

"id" => $shortname."_footer_text",

"type" => "textarea",

"std" => ""),



array( "name" => "Head Scrip(s)",

"desc" => "The content of this box will be added immediately before tag. Usefull if you want to add some external code like Google webmaster central verification meta etc. or Buysell ads Master Code",

"id" => $shortname."_head",

"type" => "textarea",

"std" => ""),



array( "name" => "Footer script(s)",

"desc" => "You can paste your Google Analytics or other tracking code in this box. This will be automatically added to the footer.",

"id" => $shortname."_footer",

"type" => "textarea",

"std" => ""),

array( "type" => "close"),



array( "name" => "Single Page Settings",

"type" => "section"),

array( "type" => "open"),

array( "name" => "Wallpaper download Message",

"desc" => "Write Down your own Wallpaper Download Message- That will be visible after Single Post Title",

"id" => $shortname."_footer_title",

"type" => "textarea",

"std" => ""),

array( "name" => "Wallpaper Disclaimer",

"desc" => "Write Down your own Disclaimer-that will be visible after related wallpaper on each singlepost",

"id" => $shortname."_footer_disclaimer",

"type" => "textarea",

"std" => ""),

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: admin.php?page=adminPanel.php&saved=true");

die;



}

else if( 'reset' == $_REQUEST['action'] ) {



foreach ($options as $value) {

delete_option( $value['id'] ); }



header("Location: admin.php?page=adminPanel.php&reset=true");

die;



}

}



add_theme_page($themename, $themename, 'administrator', basename(__FILE__), 'mytheme_admin');

}



function mytheme_add_init() {



$file_dir = get_template_directory_uri();

wp_enqueue_style("functions", $file_dir."/functions/functions.css", false, "1.0", "all");

wp_enqueue_script("rm_script", $file_dir."/functions/rm_script.js", false, "1.0");



}

function mytheme_admin() {



global $themename, $shortname, $options;

$i=0;



if ( $_REQUEST['saved'] ) echo '

'.$themename.' settings saved.

';

if ( $_REQUEST['reset'] ) echo '

'.$themename.' settings reset.

';



?>



Settings










switch ( $value['type'] ) {



case "open":

?>






case "close":

?>

















case "title":

?>

To easily use the theme, you can use the menu below.










case 'text':

?>







" />








break;



case 'textarea':

?>


















break;



case 'select':

?>


















break;



case "checkbox":

?>











/>










case "section":



$i++;



?>


















}

}

?>




























}

add_action('admin_init', 'mytheme_add_init');
add_action('admin_menu', 'mytheme_add_admin');

?>