cat_ID] = $category_list->cat_name; } array_unshift($wp_cats, "Choose a category"); add_action('admin_init', 'gazpo_init'); function gazpo_init() { $theme_dir = get_template_directory_uri(); wp_register_script('tabs', $theme_dir.'/js/gazpo_admin_tabs.js'); wp_enqueue_script('tabs'); wp_register_style('gazpo_options_css', $theme_dir.'/functions/options.css'); wp_enqueue_style('gazpo_options_css'); } //add settings menu add_action('admin_menu', 'create_gazpo_menu'); function create_gazpo_menu() { global $themename; add_theme_page( __( $themename.' Theme Options','gazpo' ), __( 'Theme Options', 'gazpo' ), 'edit_theme_options', basename(__FILE__), 'gazpo_settings_page' ); } //register settings add_action( 'admin_init', 'register_gazpo_settings' ); function register_gazpo_settings() { global $themename, $shortname, $version, $gazpo_options, $option_group, $option_name; register_setting( $option_group, $option_name); } // Create theme options global $gazpo_options; $gazpo_options = array ( array( "name" => "Gazpo Theme Settings", "type" => "title"), array( "type" => "open"), array( "type" => "menu-open"), array( "type" => "menu-item", "id" => "1", "name" => "Homepage"), array( "type" => "menu-item", "id" => "2", "name" => "Social Links"), array( "type" => "menu-item", "id" => "3", "name" => "Miscellaneous"), array( "type" => "menu-close"), array( "type" => "tab-open", "id" => "1", "name" => "Homepage Settings"), array( "type" => "preheader", "name" => "Homepage Settings"), array( "name" => __('Logo URL','gazpo'), "desc" => __('Enter full URL for logo image starting with http:// .','gazpo'), "id" => $shortname.'_logo_url', "type" => "text", "std" => get_template_directory_uri().'/images/logo.png'), array( "name" => __('Favicon URL','gazpo'), "desc" => __('Enter full URL for favicon image starting with http:// .','gazpo'), "id" => $shortname.'_favicon_url', "type" => "text", "std" => ""), array( "name" => __('Custom Feed URL','gazpo'), "desc" => __('For example FeedBurner. Please enter full URL starting with http://.','gazpo'), "id" => $shortname.'_feed_url', "type" => "text", "std" => get_bloginfo('rss2_url')), array( "name" => __('Show slider?','gazpo'), "desc" => __('Do you want to show slider on homepage?','gazpo'), "id" => $shortname.'_slider_show', "options" => array('Yes', 'No'), "std" => "Yes", "type" => "select"), array( "name" => __('Slider Category','gazpo'), "desc" => __(' Last 5 posts form the selected categoey will appear in slider. Remember to set Post Thumbnail when adding new post.','gazpo'), "id" => $shortname.'_slider_category', "type" => "select", "options" => $wp_cats, "std" => ""), array( "type" => "tab-close"), array( "type" => "tab-open", "id" => "2", "name" => "Social Links"), array( "type" => "preheader", "name" => "Set up social links"), array( "name" => __('Twitter ID','gazpo'), "desc" => __('Your Twitter page URL. Please enter full URL starting with http://.','gazpo'), "id" => $shortname.'_twt_id', "type" => "text", "std" => "http://twitter.com/gazpodotcom"), array( "name" => __('Facebook Page','gazpo'), "desc" => __('Your Facebook page URL. Please enter full URL starting with http://.','gazpo'), "id" => $shortname.'_fb_id', "type" => "text", "std" => ""), array( "name" => __('Contact Page','gazpo'), "desc" => __('Your contact page URL, starting with http://. For example http://gazpo.com/contact/ .','gazpo'), "id" => $shortname.'_contact_url', "type" => "text", "std" => ""), array( "type" => "tab-close"), array( "type" => "tab-open", "id" => "3", "name" => "Miscellaneous"), array( "type" => "preheader", "name" => "Add styles to theme"), array( "name" => __('Custom CSS','gazpo'), "desc" => __('If you want to add extra CSS code in the theme. If code conflicts, it will override existing code.','gazpo'), "id" => $shortname.'_custom_css', "type" => "textarea", "std" => ""), array( "type" => "preheader", "name" => "Tracking Code"), array( "name" => __('Tracking','gazpo'), "desc" => __('If you want to add any tracking code (eg. Google Analytics). It will appear in the footer of the theme.','gazpo'), "id" => $shortname.'_tracking_code', "type" => "textarea", "std" => ""), array( "type" => "tab-close"), array( "type" => "close") ); function gazpo_settings_page() { $theme_dir = get_template_directory_uri(); global $themename, $shortname, $version, $gazpo_options, $option_group, $option_name; ?>