'; if ('page' != get_option('show_on_front')) { echo '
  • Home
  • '; } wp_list_pages('title_li='); echo ''; } /* Excerpt ********************************************/ function km_excerptlength_teaser($length) { return 10; } function km_excerptlength_index($length) { return 45; } function km_excerptmore($more) { return '...'; } function km_excerpt($length_callback='', $more_callback='') { global $post; if(function_exists($length_callback)){ add_filter('excerpt_length', $length_callback); } if(function_exists($more_callback)){ add_filter('excerpt_more', $more_callback); } $output = get_the_excerpt(); $output = apply_filters('wptexturize', $output); $output = apply_filters('convert_chars', $output); $output = '

    '.$output.'

    '; echo $output; } /* Widgets ********************************************/ if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'Sidebar', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', )); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'Bottom Menu Left', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', )); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'Bottom Menu Center', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', )); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'Bottom Menu Right', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', )); if ( ! isset( $content_width ) ) $content_width = 590; //---------------------------- [ Pagenavi Function ] ------------------------------// function wp_pagenavi() { global $wp_query, $wp_rewrite; $pages = ''; $max = $wp_query->max_num_pages; if (!$current = get_query_var('paged')) $current = 1; $args['base'] = str_replace(999999999, '%#%', get_pagenum_link(999999999)); $args['total'] = $max; $args['current'] = $current; $total = 1; $args['mid_size'] = 3; $args['end_size'] = 1; $args['prev_text'] = '« Prev'; $args['next_text'] = 'Next »'; if ($max > 1) echo '
    '; if ($total == 1 && $max > 1) $pages = 'Page ' . $current . ' of ' . $max . ''; echo $pages . paginate_links($args); if ($max > 1) echo '
    ';
    }
    
    
    $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" => "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


    " />
    />