cat_ID] = $category_list->cat_name; } array_unshift($wp_cats, "Choose a category"); $options = array ( array( "name" => $themename." Options", "type" => "title"), // General Theme Options // ===================== array( "name" => "General", "type" => "section"), array( "type" => "open"), array( "name" => "Layout", "desc" => "Select the colour scheme for the theme", "id" => $shortname."_layout", "type" => "select", "options" => array("sidebar-left", "sidebar-right","full-width"), "std" => "sidebar-right"), array( "name" => "Logo URL", "desc" => "Enter the link to your logo image", "id" => $shortname."_logo", "type" => "text", "std" => ""), 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" => home_url() ."/favicon.ico"), 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( "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: a.button{color:green}", "id" => $shortname."_custom_css", "type" => "textarea", "std" => ""), array( "type" => "close"), // Home Page Options // =================== array( "name" => "Home Page", "type" => "section"), array( "type" => "open"), array( "name" => "Post Thumbnail", "desc" => "Enable or disable the post thumbnails.", "id" => $shortname."_thumb_index", "type" => "checkbox", "std" => false), array( "name" => "Thumbnail Size", "desc" => "Select the colour scheme for the theme", "id" => $shortname."_thumb_size_index", "type" => "select", "options" => array("extra-large-thumb", "large-thumb", "medium-thumb", "small-thumb"), "std" => "large-thumb"), array( "name" => "Thumbnail Position", "desc" => "Select the colour scheme for the theme", "id" => $shortname."_thumb_pos_index", "type" => "select", "options" => array("above", "below"), "std" => "below"), array( "name" => "Excerpt", "desc" => "Check this to show only a part of the post's content.", "id" => $shortname."_ex_index", "type" => "checkbox", "std" => ""), array( "name" => "Excerpt Length", "desc" => "How many words would you like to show? ( Only works if Excerpt is check )", "id" => $shortname."_ex_length_index", "type" => "text", "std" => "40"), array( "type" => "close"), // Single Post Options // =================== array( "name" => "Single Post/Page Settings", "type" => "section"), array( "type" => "open"), array( "name" => "Post Thumbnail", "desc" => "Enable or disable the post thumbnails.", "id" => $shortname."_thumb_single", "type" => "checkbox", "std" => false), array( "name" => "Post Thumbnail Size", "desc" => "Select the colour scheme for the theme", "id" => $shortname."_thumb_size_single", "type" => "select", "options" => array("extra-large-thumb", "large-thumb", "medium-thumb", "small-thumb"), "std" => "large-thumb"), array( "name" => "Page Thumbnail", "desc" => "Enable or disable the page thumbnails.", "id" => $shortname."_thumb_page", "type" => "checkbox", "std" => false), array( "name" => "Page Thumbnail Size", "desc" => "Select the colour scheme for the theme", "id" => $shortname."_thumb_size_page", "type" => "select", "options" => array("extra-large-thumb", "large-thumb", "medium-thumb", "small-thumb"), "std" => "large-thumb"), array( "type" => "close"), // Footer Options // ============== 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" => "text", "std" => ""), array( "name" => "Code in The footer", "desc" => "Add code to the theme's footer using this text box. ( ex: google analytics )", "id" => $shortname."_footer_code", "type" => "textarea", "std" => ""), array( "type" => "close"), // SEO Options // ===================== array( "name" => "SEO Settings", "type" => "section"), array( "type" => "open"), array( "name" => "Enable Homepage meta keywords", "desc" => "Enable or disable Homepage meta keywords.", "id" => $shortname."_home_keyword_setting", "type" => "checkbox", "std" => false), array( "name" => "Homepage meta keywords", "desc" => "Add keywords for you homepage. Seperate them with comma.", "id" => $shortname."_home_keyword", "type" => "text", "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( $_REQUEST[ $value['id'] ] ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } } header("Location: admin.php?page=theme-options.php&saved=true"); die; } else if( 'reset' == $_REQUEST['action'] ) { foreach ($options as $value) { delete_option( $value['id'] ); } header("Location: admin.php?page=theme-options.php&reset=true"); die; } } add_theme_page($themename, $themename, 'administrator', basename(__FILE__), 'mytheme_admin'); } function mytheme_add_init() { $file_dir=get_bloginfo('template_directory'); wp_enqueue_style("functions", $file_dir."/lib/options/theme-options.css", false, "1.0", "all"); wp_enqueue_script("rm_script", $file_dir."/lib/options/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


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

" />
/>

add_menu( array( 'id' => 'codex_search', 'title' => __( 'Acer Options', 'acer' ), 'href' => $url . '/wp-admin/themes.php?page=theme-options.php' ) ); } add_action( 'admin_bar_menu', 'wp_theme_options', 1000 ); add_action('admin_init', 'mytheme_add_init'); add_action('admin_menu', 'mytheme_add_admin');