'f3f3f3', 'border' => 'ddd', 'text' => '666', 'link' => '0087c1', 'url' => '0087c1', ); } else { $themecolors = array( 'bg' => '3c3c3c', 'border' => '2f2f2f', 'text' => '999999', 'link' => 'ff9900', 'url' => '0099cc', ); } // Set the content width $content_width = 520; // Get current theme options with defaults as fallback function vostok_get_theme_options() { $defaults = array( 'color_scheme' => 'dark', 'show-header-image' => 0, 'show-header-nav' => 0, ); $options = get_option( 'vostok_theme_options', $defaults ); return $options; } function twentyten_setup() { // This theme styles the visual editor with editor-style.css to match the theme style. // add_editor_style(); // This theme uses post thumbnails add_theme_support( 'post-thumbnails' ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => __( 'Primary Navigation', 'vostok' ), 'footer' => __( 'Footer Navigation', 'vostok' ), ) ); // Add default posts and comments RSS feed links to head add_theme_support( 'automatic-feed-links' ); // Make theme available for translation // Translations can be filed in the /languages/ directory load_child_theme_textdomain( 'vostok', get_stylesheet_directory() . '/languages' ); // This theme allows users to set a custom background add_theme_support( 'custom-background' ); add_theme_support( 'print-style' ); $options = vostok_get_theme_options(); if ( ! empty( $options['show-header-image'] ) ) { // Your changeable header business starts here add_theme_support( 'custom-header', apply_filters( 'vostok_custom_header_args', array( 'default-image' => '%s/images/headers/path.jpg', 'width' => apply_filters( 'twentyten_header_image_width', 600 ), 'height' => apply_filters( 'twentyten_header_image_height', 126 ), 'header-text' => false, 'admin-head-callback' => 'twentyten_admin_header_style', ) ) ); // We'll be using post thumbnails for custom header images on posts and pages. // We want them to be 600 pixels wide by 126 pixels tall (larger images will be auto-cropped to fit). set_post_thumbnail_size( get_custom_header()->width, get_custom_header()->height, true ); // ... and thus ends the changeable header business. // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers( array( 'berries' => array( 'url' => '%s/images/headers/berries.jpg', 'thumbnail_url' => '%s/images/headers/berries-thumbnail.jpg', 'description' => __( 'Berries', 'vostok' ) ), 'cherryblossom' => array( 'url' => '%s/images/headers/cherryblossoms.jpg', 'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg', 'description' => __( 'Cherry Blossoms', 'vostok' ) ), 'concave' => array( 'url' => '%s/images/headers/concave.jpg', 'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg', 'description' => __( 'Concave', 'vostok' ) ), 'fern' => array( 'url' => '%s/images/headers/fern.jpg', 'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg', 'description' => __( 'Fern', 'vostok' ) ), 'forestfloor' => array( 'url' => '%s/images/headers/forestfloor.jpg', 'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg', 'description' => __( 'Forest Floor', 'vostok' ) ), 'inkwell' => array( 'url' => '%s/images/headers/inkwell.jpg', 'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg', 'description' => __( 'Inkwell', 'vostok' ) ), 'path' => array( 'url' => '%s/images/headers/path.jpg', 'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg', 'description' => __( 'Path', 'vostok' ) ), 'sunset' => array( 'url' => '%s/images/headers/sunset.jpg', 'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg', 'description' => __( 'Sunset', 'vostok' ) ) ) ); } } // Register widgetized areas function vostok_widgets_init() { // Area 1 (left column) register_sidebar( array( 'name' => 'Left Footer Widget Area', 'id' => 'primary-widget-area', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); // Area 2 (right column) register_sidebar( array( 'name' => 'Right Footer Widget Area', 'id' => 'secondary-widget-area', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); } // Replace default functions in Twenty Ten with our own. function vostok_setup() { // Use different Vostok widget areas. remove_action( 'widgets_init', 'twentyten_widgets_init' ); add_action( 'widgets_init', 'vostok_widgets_init' ); // Don't load the WP.com compat styles for Twenty Ten. remove_action( 'wp_enqueue_scripts', 'twentyten_wpcom_styles' ); } add_action( 'after_setup_theme', 'vostok_setup' ); /** * Enqueue scripts and styles */ function vostok_scripts() { wp_enqueue_style( 'vostok', get_stylesheet_uri() ); // Register the light color scheme $color_scheme = vostok_get_color_scheme(); if ( isset( $color_scheme ) && 'light' == $color_scheme ) wp_enqueue_style( 'vostok-white', get_stylesheet_directory_uri() . '/css/white.css', null, null ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); } add_action( 'wp_enqueue_scripts', 'vostok_scripts' ); // Return current color scheme function vostok_get_color_scheme() { $options = vostok_get_theme_options(); return $options['color_scheme']; } /** * Filters wp_title to print a neat tag based on what is being viewed. */ function vostok_wp_title( $title, $sep ) { global $page, $paged; if ( is_feed() ) return $title; // Add the blog name $title .= get_bloginfo( 'name' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title .= " $sep $site_description"; // Add a page number if necessary: if ( $paged >= 2 || $page >= 2 ) $title .= " $sep " . sprintf( __( 'Page %s', 'vostok' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'vostok_wp_title', 10, 2 ); // We loves us some Theme Options =] require get_stylesheet_directory() . '/inc/theme-options.php';