'; if ('page' != get_option('show_on_front')) { echo '
'.$output.'
'; echo $output; } /* Widgets ********************************************/ if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'Sidebar', 'before_widget' => '';
}
$alt_stylesheet_path = get_template_directory() . '/';
$alt_stylesheets = array();
if ( is_dir($alt_stylesheet_path) ) {
if ($alt_stylesheet_dir = opendir($alt_stylesheet_path) ) {
while ( ($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== false ) {
if(stristr($alt_stylesheet_file, ".css") !== false) {
$alt_stylesheets[] = $alt_stylesheet_file;
}
}
}
}
$args = array(
'flex-width' => true,
'width' => 460,
'flex-height' => true,
'height' => 120,
'default-image' => get_template_directory_uri() . '/images/logo.png',
);
add_theme_support( 'custom-header', $args );
$bgr = array(
'default-color' => '',
'default-image' => '',
'wp-head-callback' => '_custom_background_cb',
'admin-head-callback' => '',
'admin-preview-callback' => ''
);
add_theme_support( 'custom-background', $bgr);
/* Theme Options ********************************************/
$themename = "Abnomize";
$shortname = "km";
$categories = get_categories('hide_empty=0&orderby=name');
$wp_cats = array();
foreach ($categories as $category_list ) {
$wp_cats[$category_list->cat_ID] = $category_list->cat_name;
}
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' => __('StyleSheet', 'mytheme'),
'desc' => __('Select a color scheme', 'mytheme'),
'id' => 'alt_stylesheet',
'type' => 'select',
'options' => $alt_stylesheets,
"std" => "style.css"),
array(
'flex-width' => "true",
'width' => "980",
'flex-height' => "true",
'height' => "200",
'default-image' => "get_template_directory_uri() . '/images/header.jpg'",
),
array( "name" => "Logo URL",
"desc" => "Enter the link to your logo image.",
"id" => $shortname."_logo",
"type" => "text",
"std" => ""),
array( "name" => "Shortcut Icon",
"desc" => "Enter the link to your shortcut icon.",
"id" => $shortname."_shortcut_icon",
"type" => "text",
"std" => ""),
array( "name" => "Custom CSS",
"desc" => "Want to add any custom CSS code? Put in here, and the rest is taken care of. This overrides any other stylesheets. eg: body { color: blue; }",
"id" => $shortname."_custom_css",
"type" => "textarea",
"std" => ""),
array( "name" => "Header Script",
"desc" => "Paste Any Script or Code for Header ",
"id" => $shortname."_header_script",
"type" => "textarea",
"std" => ""),
array( "name" => "Activate Tabs Menu in Sidebar",
"desc" => "Check the box to activate tabs menu in sidebar (popular posts and categories).",
"id" => $shortname."_activate_tabs",
"type" => "checkbox",
"std" => "true"),
array( "name" => "Show Search Box ",
"desc" => "Check the box to show Search Box in Right Side From Navigation.",
"id" => $shortname."_Search",
"type" => "checkbox",
"std" => "true"),
array( "name" => "Show Author Profile ",
"desc" => "Check the box to show Author Profile Below the Post.",
"id" => $shortname."_author",
"type" => "checkbox",
"std" => "true"),
array( "type" => "close"),
array( "name" => "Theme SEO Options",
"type" => "section"),
array( "type" => "open"),
array( "name" => "Auto Generate Meta Description",
"desc" => "Check box to Auto Generate SEO Meta Description",
"id" => $shortname."_metades",
"type" => "checkbox",
"std" => "true"),
array( "name" => "Remove Shortlink ",
"desc" => "Remove Wordpress Default Shortlink From Header",
"id" => $shortname."_sortlink",
"type" => "checkbox",
"std" => "true"),
array( "name" => "Generate Canonical Links ",
"desc" => "Automatic Generate Canonical Links in all Site",
"id" => $shortname."_canonical",
"type" => "checkbox",
"std" => "true"),
array( "type" => "close"),
array( "name" => "Social Media",
"type" => "section"),
array( "type" => "open"),
array( "name" => "Facebook Link",
"desc" => "Enter Facebook Page address.",
"id" => $shortname."_fb",
"type" => "text",
"std" => "http://www.facebook.com/allnewtricks"),
array( "name" => "Twitter Link",
"desc" => "Enter twitter address.",
"id" => $shortname."_tw",
"type" => "text",
"std" => "https://twitter.com/wrockorg"),
array( "name" => "Google Plus Link",
"desc" => "Enter Google address.",
"id" => $shortname."_gp",
"type" => "text",
"std" => "Paste Google Plus URL"),
array( "name" => "RSS Feed url Link",
"desc" => "Enter RSS feed address.",
"id" => $shortname."_rss",
"type" => "text",
"std" => "http://feeds.feedburner.com/srdelta"),
array( "type" => "close"),
array( "name" => "Ads Management",
"type" => "section"),
array( "type" => "open"),
array( "name" => "Activate Banner Ad in Header?",
"desc" => "Check the box to activate banner ad in header area. Banner ad size is 468 x 60px.",
"id" => $shortname."_activate_banner_top",
"type" => "checkbox",
"std" => "true"),
array( "name" => "Banner Ad URL",
"desc" => "Enter your banner ad code here.",
"id" => $shortname."_banner_top",
"type" => "textarea",
"std" => ""),
array( "name" => "Ad area below the Categories navigation",
"desc" => "Enter your ad code here, preferably a 728*15 link list unit, or a 728*90 lead-board ad.",
"id" => $shortname."_ad3",
"std" => "",
"type" => "textarea"),
array( "name" => "AD Code For Single Post",
"desc" => "Path of the image to be displayed in sidebar section",
"id" => $shortname."_ad2",
"std" => "",
"type" => "textarea"),
array( "name" => "AD Code For Footer",
"desc" => "Paste the Ad code for Footer Below the Navigation",
"id" => $shortname."_ad1",
"std" => "",
"type" => "textarea"),
array( "type" => "close"),
array( "name" => "Footer",
"type" => "section"),
array( "type" => "open"),
array( "name" => "Footer text",
"desc" => "Enter text used in the footer. It can be HTML",
"id" => $shortname."_footer_text",
"type" => "textarea",
"std" => ""),
array( "name" => "Google Analytics Code",
"desc" => "Paste your Google Analytics or other tracking code in this box. This will be automatically added to the footer.",
"id" => $shortname."_ga_code",
"type" => "textarea",
"std" => ""),
array( "type" => "close")
);
function mytheme_add_admin() {
global $themename, $shortname, $options;
if ( isset($_GET['page']) && $_GET['page'] == basename(__FILE__) ) {
if ( 'save' == ( isset($_REQUEST['action'] ) && $_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=functions.php&saved=true");
header("Location: themes.php?page=functions.php&saved=true");
die;
} else if ( 'reset' == ( isset($_REQUEST['action'] ) && $_REQUEST['action'] ) ) {
foreach ($options as $value) {
delete_option( $value['id'] ); }
header("Location: admin.php?page=functions.php&reset=true");
header("Location: themes.php?page=functions.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 ( isset( $_REQUEST['saved'] ) && $_REQUEST['saved']) echo ''.$themename.' settings saved.
';
if ( isset( $_REQUEST['reset'] ) && $_REQUEST['reset']) echo ''.$themename.' settings reset.
';
?>
Settings
" />
/>
; ?>/functions/images/trans.png)