'Main Sidebar',
'before_widget' => '
',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
));
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name'=>'Footer Sidebar',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
));
// Separates the Trackback/Comment count
add_filter('get_comments_number', 'comment_count', 0);
function comment_count( $count ) {
if ( ! is_admin() ) {
global $id;
$comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id));
return count($comments_by_type['comment']);
} else {
return $count;
}
}
// Turns Off Post Navigation If There Is Under Only One Page
// If more than one page exists, return TRUE.
function show_posts_nav() {
global $wp_query;
return ($wp_query->max_num_pages > 1);
}
// Theme Options
// Don't Touch, Unless you know what you're doing!
$themename = "Blank";
$shortname = "blk";
$options = array (
// Header
array( "name" => "Header",
"type" => "heading"),
array( "name" => "",
"id" => $shortname."_meta_title",
"std" => "",
"desc" => "Title displayed in the brower and on search engines.
",
"type" => "text"),
array( "name" => "",
"id" => $shortname."_meta_description",
"std" => "",
"desc" => "Describe your site. These keywords will be shown to Google and other search engines.
",
"type" => "text"),
array( "name" => "",
"id" => $shortname."_meta_keywords",
"std" => "",
"desc" => "Keywords for your site. This description will be shown to Google and other search engines.
",
"type" => "textarea"),
array( "name" => "",
"id" => $shortname."_favicon_box",
"std" => "",
"desc" => "Favicon link. 32x32px MAX. Please include the http://.
",
"type" => "text"),
array( "name" => "",
"desc" => "Display 'Home' link in navigation.
",
"id" => $shortname."_homenav_check",
"std" => "false",
"type" => "checkbox"),
array( "name" => "",
"desc" => "Use a custom logo? Leaving this blank will display your Blog title anyway.
",
"id" => $shortname."_logo_check",
"std" => "false",
"type" => "checkbox"),
array( "name" => "",
"id" => $shortname."_logo_box",
"std" => "",
"desc" => "Logo link. 500x100px MAX. Please include the http://.
",
"type" => "text"),
//Sidebar
array( "name" => "Sidebar",
"type" => "heading"),
array( "name" => "",
"desc" => "Don't display the multi-box (Recent Posts, Archives, Categories and Tags in one!
",
"id" => $shortname."_multibox_check",
"std" => "false",
"type" => "checkbox"),
array( "name" => "",
"desc" => "Don't display the search box.
",
"id" => $shortname."_search_check",
"std" => "false",
"type" => "checkbox"),
//Post
array( "name" => "Posts",
"type" => "heading"),
array( "name" => "",
"desc" => "Social Media Sharing Icons.
",
"id" => $shortname."_sharing_check",
"std" => "false",
"type" => "checkbox"),
array( "name" => "",
"desc" => "Related Posts.
",
"id" => $shortname."_related_check",
"std" => "false",
"type" => "checkbox"),
//Footer
array( "name" => "Footer",
"type" => "heading"),
array( "name" => "",
"desc" => "Expand the footer to include a Avatar, About section and another widget bar.
",
"id" => $shortname."_footer_check",
"std" => "false",
"type" => "checkbox"),
array( "name" => "",
"id" => $shortname."_footer_avatar_box",
"std" => "",
"desc" => "Avatar link. 200x200px MAX. Please include the http://.
",
"type" => "text"),
array( "name" => "",
"id" => $shortname."_footer_about_box",
"std" => "",
"desc" => "A short about section.
",
"type" => "textarea"),
// Analytics
array( "name" => "",
"id" => $shortname."_analytics_box",
"std" => "",
"desc" => "Google Analytics code will be placed in the footer. Make sure it is commented out.
",
"type" => "textarea"),
);
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.
';
?>