section add_theme_support( 'automatic-feed-links' ); $this->register_sidebars(); add_theme_support( 'post-thumbnails' ); add_action('wp_enqueue_scripts', array($this, 'load_scripts')); add_action('wp_enqueue_scripts', array($this, 'load_styles')); add_action('wp_head', array($this, 'custom_css')); } /** * Load the frontend scripts in the header */ function load_scripts(){ wp_register_script(DIFFBLUE_L10N.'_core', get_template_directory_uri().'/js/scripts.js', array('jquery')); wp_enqueue_script(DIFFBLUE_L10N.'_core'); } /** * Load the frontend styles in the header */ function load_styles(){ wp_register_style(DIFFBLUE_L10N.'_bootstrap', get_template_directory_uri().'/css/bootstrap.min.css'); wp_register_style(DIFFBLUE_L10N.'_bootstrap_responsive', get_template_directory_uri().'/css/bootstrap-responsive.min.css'); wp_register_style(DIFFBLUE_L10N.'_style', get_stylesheet_uri()); wp_enqueue_style(array( DIFFBLUE_L10N.'_bootstrap', DIFFBLUE_L10N.'_bootstrap_responsive', DIFFBLUE_L10N.'_style' )); } /** * Display custom CSS in the header if set */ function custom_css(){ $custom_css = stripslashes(get_option(theme_setup_different_blue::$theme_prefix . '_custom_css')); if($custom_css){ echo ''; } } /** * Register the 3 sidebars for this theme */ function register_sidebars(){ // Declare sidebar widget zone if (function_exists('register_sidebar')) { register_sidebar(array( 'name' => 'Left One', 'id' => 'sidebar-1', 'description' => 'This is the left most sidebar of your blog', 'before_widget' => '
', 'before_title' => '' )); register_sidebar(array( 'name' => 'Left Two', 'id' => 'sidebar-2', 'description' => 'This is the center sidebar of your blog', 'before_widget' => '', 'before_title' => '' )); register_sidebar(array( 'name' => 'Footer Sidebar', 'id' => 'sidebar-footer', 'description' => 'This is the sidebar at the footer of the page', 'before_widget' => '', 'before_title' => '' )); } } /** * Load the textdomain to be used for this theme for localization */ function localize_init(){ load_theme_textdomain(DIFFBLUE_L10N, get_template_directory() . '/languages'); } // Setup the theme's WordPress admin page function setup_theme_admin_menus() { add_theme_page( $this->adminPageTitle, $this->adminPageShortTitle, 'manage_options', 'different-blue-options', array($this, 'renderAdminPage') ); } function renderAdminPage(){ // Check for permissions if (!current_user_can('manage_options')){ wp_die('You do not have sufficient permissions to access this page.'); exit; } // Save data if the form is submitted if($_POST && is_array($_POST)){ update_option(self::$theme_prefix . '_google_analytics', ($_POST[self::$theme_prefix . '_google_analytics'] )); update_option(self::$theme_prefix . '_custom_css', addslashes($_POST[self::$theme_prefix . '_custom_css'] )); } $analytics_code = htmlentities(stripslashes(get_option(self::$theme_prefix . '_google_analytics'))); $custom_css = htmlentities(stripslashes(get_option(self::$theme_prefix . '_custom_css'))); ?>'; return $output; } else return $content; } } new theme_setup_different_blue(); if ( ! isset( $content_width ) ) $content_width = 900; ?>