Example #1
0
 function bones_setup()
 {
     $options = get_option('bones_theme_options');
     // This theme uses post thumbnails
     add_theme_support('post-thumbnails');
     // Add default posts and comments RSS feed links to head
     add_theme_support('automatic-feed-links');
     // This theme uses wp_nav_menu() in one location.
     register_nav_menus(array('primary' => __('Primary Navigation', 'bones')));
     // This theme allows users to set a custom background
     // TODO: Add option to implement add_custom_background();
     if ($options['header_type'] == 'image') {
         // Your changeable header business starts here
         define('HEADER_TEXTCOLOR', '');
         // No CSS, just IMG call. The %s is a placeholder for the theme template directory URI.
         define('HEADER_IMAGE', '%s/images/headers/path.jpg');
         // The height and width of your custom header. You can hook into the theme's own filters to change these values.
         // Add a filter to twentyten_header_image_width and twentyten_header_image_height to change these values.
         define('HEADER_IMAGE_WIDTH', apply_filters('bones_header_image_width', $options['header_width']));
         define('HEADER_IMAGE_HEIGHT', apply_filters('bones_header_image_height', $options['header_height']));
         // Don't support text inside the header image.
         define('NO_HEADER_TEXT', true);
         // Add a way for the custom header to be styled in the admin panel that controls
         // custom headers. See twentyten_admin_header_style(), below.
         add_custom_image_header('', 'bones_admin_header_style');
         // ... and thus ends the changeable header business.
     }
 }
Example #2
0
 /**
  * Sets up theme defaults and registers support for WordPress features. 
  */
 function yoko()
 {
     // 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');
     // Add default posts and comments RSS feed links to head
     add_theme_support('automatic-feed-links');
     // This theme uses wp_nav_menu() in one location.
     register_nav_menus(array('primary' => __('Primary Navigation', 'yoko')));
     // Add support for Post Formats
     add_theme_support('post-formats', array('aside', 'gallery', 'link', 'video', 'image', 'quote'));
     // This theme allows users to set a custom background
     add_custom_background();
     // Your changeable header business starts here
     define('HEADER_TEXTCOLOR', '');
     // No CSS, just IMG call. The %s is a placeholder for the theme template directory URI.
     define('HEADER_IMAGE', '%s/images/headers/ginko.jpg');
     // The height and width of your custom header. You can hook into the theme's own filters to change these values.
     // Add a filter to yoko_header_image_width and yoko_header_image_height to change these values.
     define('HEADER_IMAGE_WIDTH', apply_filters('yoko_header_image_width', 1102));
     define('HEADER_IMAGE_HEIGHT', apply_filters('yoko_header_image_height', 350));
     // We'll be using post thumbnails for custom header images on posts and pages.
     // We want them to be 940 pixels wide by 350 pixels tall.
     // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
     set_post_thumbnail_size(HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true);
     // Don't support text inside the header image.
     define('NO_HEADER_TEXT', true);
     // Add a way for the custom header to be styled in the admin panel that controls
     // custom headers. See yoko_admin_header_style(), below.
     add_custom_image_header('', 'yoko_admin_header_style');
     // ... 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('ginko' => array('url' => '%s/images/headers/ginko.jpg', 'thumbnail_url' => '%s/images/headers/ginko-thumbnail.jpg', 'description' => __('Ginko', 'yoko')), 'flowers' => array('url' => '%s/images/headers/flowers.jpg', 'thumbnail_url' => '%s/images/headers/flowers-thumbnail.jpg', 'description' => __('Flowers', 'yoko')), 'plant' => array('url' => '%s/images/headers/plant.jpg', 'thumbnail_url' => '%s/images/headers/plant-thumbnail.jpg', 'description' => __('Plant', 'yoko')), 'sailing' => array('url' => '%s/images/headers/sailing.jpg', 'thumbnail_url' => '%s/images/headers/sailing-thumbnail.jpg', 'description' => __('Sailing', 'yoko')), 'cape' => array('url' => '%s/images/headers/cape.jpg', 'thumbnail_url' => '%s/images/headers/cape-thumbnail.jpg', 'description' => __('Cape', 'yoko')), 'seagull' => array('url' => '%s/images/headers/seagull.jpg', 'thumbnail_url' => '%s/images/headers/seagull-thumbnail.jpg', 'description' => __('Seagull', 'yoko'))));
 }
 function bouquet_setup()
 {
     // This theme has an options page that lets users pick layout, color scheme, featured post title text and configure a twitter icon
     //require_once( dirname( __FILE__ ) . '/inc/theme-options.php' );
     // Make theme available for translation
     load_theme_textdomain('bouquet', get_template_directory() . '/languages');
     $locale = get_locale();
     $locale_file = get_template_directory() . "/languages/{$locale}.php";
     if (is_readable($locale_file)) {
         require_once $locale_file;
     }
     // Add default posts and comments RSS feed links to head
     add_theme_support('automatic-feed-links');
     // This theme uses wp_nav_menu() in one location.
     register_nav_menus(array('primary' => __('Primary Menu', 'bouquet')));
     // This theme allows users to set a custom background.
     add_custom_background();
     // This theme allows users to upload a custom header.
     define('HEADER_TEXTCOLOR', bouquet_header_text_color());
     define('HEADER_IMAGE', '');
     define('HEADER_IMAGE_WIDTH', 1100);
     // use width and height appropriate for your theme
     define('HEADER_IMAGE_HEIGHT', 180);
     // Add a way for the custom header to be styled in the admin panel that controls
     // custom headers. See bouquet_admin_header_style(), below.
     add_custom_image_header('bouquet_header_style', 'bouquet_admin_header_style');
     // Add support for Post Formats
     add_theme_support('post-formats', array('aside', 'image', 'gallery'));
 }
function pinktouch_setup()
{
    load_theme_textdomain('pinktouch', get_template_directory() . '/languages');
    $locale = get_locale();
    $locale_file = get_template_directory() . "/languages/{$locale}.php";
    if (is_readable($locale_file)) {
        require_once $locale_file;
    }
    // This theme uses wp_nav_menu() in one location.
    register_nav_menu('primary', __('Primary Menu', 'pinktouch'));
    // Add default posts and comments RSS feed links to head.
    add_theme_support('automatic-feed-links');
    // Enable Post Formats.
    add_theme_support('post-formats', array('aside', 'gallery', 'image', 'quote', 'link', 'chat', 'audio', 'video'));
    // Add support for custom backgrounds.
    add_custom_background();
    // The default header text color
    define('HEADER_TEXTCOLOR', '000000');
    define('HEADER_IMAGE', '');
    define('HEADER_IMAGE_WIDTH', 690);
    define('HEADER_IMAGE_HEIGHT', 185);
    /**
     * Add a way for the custom header to be styled in the admin panel that controls custom headers.
     * See pinktouch_admin_header_style(), below.
     */
    add_custom_image_header('pinktouch_header_style', 'pinktouch_admin_header_style');
}
/**
 * Tell WordPress to run next_saturday_setup() when the 'after_setup_theme' hook is run.
 */
function next_saturday_setup() {

	// Add default posts and comments RSS feed links to head
	add_theme_support( 'automatic-feed-links' );

	// This theme supports post formats.
	add_theme_support( 'post-formats', array( 'aside', 'chat', 'audio', 'image', 'quote', 'gallery', 'video', 'link' ) );

	// Make theme available for translation
	// Translations can be filed in the /languages/ directory
	load_theme_textdomain( 'next-saturday', TEMPLATEPATH . '/languages' );

	// This theme uses wp_nav_menu() in one location.
	register_nav_menus( array(
		'primary' => __( 'Primary Menu', 'next-saturday' ),
	) );

	// This theme allows users to set a custom background.
	add_custom_background();

	// This theme allows users to upload a custom header.
	define( 'HEADER_TEXTCOLOR', 'f3d769' );
	define( 'HEADER_IMAGE', '' );
	define( 'HEADER_IMAGE_WIDTH', 615 ); // use width and height appropriate for your theme
	define( 'HEADER_IMAGE_HEIGHT', 85 );

	// Add a way for the custom header to be styled in the admin panel that controls
	// custom headers. See mystique_admin_header_style(), below.
	add_custom_image_header( 'next_saturday_header_style', 'next_saturday_admin_header_style' );

}
Example #6
0
 /**
  * Sets up theme defaults and registers support for various WordPress features.
  *
  * To override onemozilla_setup() in a child theme, add your own onemozilla_setup to your child theme's
  * functions.php file.
  *
  * @uses load_theme_textdomain() For translation/localization support.
  * @uses add_editor_style() To style the visual editor.
  * @uses add_theme_support() To add support for post thumbnails.
  * @uses register_nav_menus() To add support for navigation menus.
  * @uses add_custom_background() To add support for a custom background.
  * @uses add_custom_image_header() To add support for a custom header.
  * @uses register_default_headers() To register the default custom header images provided with the theme.
  * @uses set_post_thumbnail_size() To set a custom post thumbnail size.
  *
  */
 function onemozilla_setup()
 {
     /* Make the theme available for translation.
      * Translations can be added to the /languages/ directory.
      */
     load_theme_textdomain('onemozilla', get_template_directory() . '/languages');
     $locale = get_locale();
     $locale_file = get_template_directory() . "/languages/{$locale}.php";
     if (is_readable($locale_file)) {
         require_once $locale_file;
     }
     // Load up our theme options page and related code.
     require get_template_directory() . '/inc/theme-options.php';
     // This theme uses wp_nav_menu() in one location.
     register_nav_menu('primary', __('Primary Menu', 'onemozilla'));
     // This theme uses Featured Images (also known as post thumbnails)
     add_theme_support('post-thumbnails');
     // The height and width of your custom header.
     // Add a filter to onemozilla_header_image_width and onemozilla_header_image_height to change these values.
     define('HEADER_IMAGE_WIDTH', apply_filters('onemozilla_header_image_width', 340));
     define('HEADER_IMAGE_HEIGHT', apply_filters('onemozilla_header_image_height', 240));
     // Add a way for the custom header to be styled in the admin panel that controls
     // custom headers. See onemozilla_admin_header_style(), below.
     global $wp_version;
     if (version_compare($wp_version, '3.4', '>=')) {
         $defaults = array('wp-head-callback' => 'onemozilla_header_style', 'admin-head-callback' => 'onemozilla_admin_header_style', 'admin-preview-callback' => 'onemozilla_admin_header_image');
         add_theme_support('custom-header', $defaults);
     } else {
         add_custom_image_header('onemozilla_header_style', 'onemozilla_admin_header_style', 'onemozilla_admin_header_image');
     }
     // Disable the header text and color options
     define('NO_HEADER_TEXT', 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('firefox' => array('url' => '%s/img/headers/firefox.png', 'thumbnail_url' => '%s/img/headers/firefox-thumbnail.png', 'description' => __('Firefox Logo', 'onemozilla'))));
     // We've moved the share_posts and hide_authors out of theme options but we'll bring over those settings (if they exist)
     $options = get_option('onemozilla_theme_options');
     // Stash the values in variables
     if (isset($options['color_scheme'])) {
         $color_scheme = $options['color_scheme'];
     }
     if (isset($options['share_posts'])) {
         $share_posts = $options['share_posts'];
     }
     if (isset($options['hide_author'])) {
         $hide_authors = $options['hide_author'];
     }
     if (isset($share_posts) && get_option('onemozilla_share_posts') == null) {
         update_option('onemozilla_share_posts', $share_posts);
     }
     if (isset($hide_authors) && get_option('onemozilla_hide_authors') == null) {
         update_option('onemozilla_hide_authors', $hide_authors);
     }
     // Remove the old values from theme_options, we're only keeping the color scheme (if set)
     if (isset($color_scheme)) {
         update_option('onemozilla_theme_options', array('color_scheme' => $color_scheme));
     } else {
         update_option('onemozilla_theme_options', array('color_scheme' => 'stone'));
     }
 }
Example #7
0
/**
 * Performs setup functions for the theme
 *
 * @since 0.1
 */
function classblogging_setup()
{
    add_editor_style();
    add_theme_support('automatic-feed-links');
    // Configure the customizable image header
    define('NO_HEADER_TEXT', true);
    define('HEADER_TEXTCOLOR', '');
    define('HEADER_IMAGE', '%s/images/default-header.png');
    define('HEADER_IMAGE_WIDTH', 222);
    define('HEADER_IMAGE_HEIGHT', 108);
    add_custom_image_header('', 'classblogging_admin_header_style');
    // Set the content width
    global $content_width;
    if (!isset($content_width)) {
        $content_width = 720;
    }
    // Register navigation menu
    register_nav_menus(array('primary_nav' => __('Primary Navigation', 'classblogging')));
    // Enable i18n functionality
    load_theme_textdomain('classblogging', get_template_directory() . '/languages');
    $locale = get_locale();
    $locale_file = get_template_directory() . "/languages/{$locale}.php";
    if (is_readable($locale_file)) {
        require_once $locale_file;
    }
}
Example #8
0
/**
 * Techozoic Theme setup
 *
 * Setup theme translation, theme features, menus, and custom header
 * 
 *
 * @access    private
 * @since     2.0
 */
function techozoic_setup()
{
    global $content_width;
    load_theme_textdomain('techozoic', get_template_directory() . '/languages');
    $locale = get_locale();
    $locale_file = get_template_directory() . "/languages/{$locale}.php";
    if (is_readable($locale_file)) {
        require_once $locale_file;
    }
    // Include other custom functions files
    include get_template_directory() . '/functions/tech-widget.php';
    include get_template_directory() . '/functions/tech-comments-functions.php';
    include get_template_directory() . '/functions/tech-css.php';
    add_theme_support('post-thumbnails');
    add_image_size('single-post-thumbnail', $content_width, 9999);
    //WP 2.9 Post Thumbnail Support
    add_theme_support('automatic-feed-links');
    //WP Auto Feed Links
    add_theme_support('post-formats', array('aside', 'gallery', 'quote', 'status'));
    //WP Post Format
    register_nav_menus(array('primary' => __('Header Navigation', 'techozoic'), 'sidebar' => __('Sidebar Navigation', 'techozoic'), 'footer' => __('Footer Navigation', 'techozoic')));
    //WP Navigation Menu
    add_theme_support('custom-header', array('random-default' => true));
    //WP Custom Header - random roation by default
    define('HEADER_TEXTCOLOR', '');
    define('HEADER_IMAGE', '');
    define('HEADER_IMAGE_HEIGHT', of_get_option('header_height', '200'));
    define('HEADER_IMAGE_WIDTH', of_get_option('header_width', '1000'));
    define('NO_HEADER_TEXT', true);
    add_custom_image_header('techozoic_header_style', 'techozoic_admin_header_style', 'techozoic_admin_header_image');
    register_default_headers(array('grunge' => array('url' => '%s/images/headers/Grunge.jpg', 'thumbnail_url' => '%s/images/headers/Grunge-thumbnail.jpg', 'description' => __('Grunge', 'techozoic')), 'landscape' => array('url' => '%s/images/headers/Landscape.jpg', 'thumbnail_url' => '%s/images/headers/Landscape-thumbnail.jpg', 'description' => __('Landscape', 'techozoic')), 'random_lines_1' => array('url' => '%s/images/headers/Random_Lines_1.jpg', 'thumbnail_url' => '%s/images/headers/Random_Lines_1-thumbnail.jpg', 'description' => __('Random Lines 1', 'techozoic')), 'random_lines_2' => array('url' => '%s/images/headers/Random_Lines_2.jpg', 'thumbnail_url' => '%s/images/headers/Random_Lines_2-thumbnail.jpg', 'description' => __('Random Lines 2', 'techozoic')), 'technology' => array('url' => '%s/images/headers/Technology.jpg', 'thumbnail_url' => '%s/images/headers/Technology-thumbnail.jpg', 'description' => __('Technology', 'techozoic'))));
}
Example #9
0
 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()
     add_theme_support('nav-menus');
     // 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_theme_textdomain('twentyten', TEMPLATEPATH . '/languages');
     $locale = get_locale();
     $locale_file = TEMPLATEPATH . "/languages/{$locale}.php";
     if (is_readable($locale_file)) {
         require_once $locale_file;
     }
     // No CSS, just IMG call. The %s is a placeholder for the theme template directory URI.
     define('HEADER_IMAGE', '%s/images/headers/forestfloor.jpg');
     // The height and width of your custom header. You can hook into the theme's own filters to change these values.
     // Add a filter to twentyten_header_image_width and twentyten_header_image_height to change these values.
     define('HEADER_IMAGE_WIDTH', apply_filters('twentyten_header_image_width', 940));
     define('HEADER_IMAGE_HEIGHT', apply_filters('twentyten_header_image_height', 500));
     // Add a way for the custom header to be styled in the admin panel that controls
     // custom headers. See twentyten_admin_header_style(), below.
     add_custom_image_header('', 'twentyten_admin_header_style');
 }
 function danhuaer_setup()
 {
     add_editor_style();
     add_theme_support('post-thumbnails');
     add_theme_support('automatic-feed-links');
     load_theme_textdomain('danhuaer', get_template_directory() . '/languages');
     $locale = get_locale();
     $locale_file = get_template_directory() . "/languages/{$locale}.php";
     if (is_readable($locale_file)) {
         require_once $locale_file;
     }
     register_nav_menus(array('primary' => __('Primary Navigation', 'danhuaer')));
     add_custom_background();
     if (!defined('HEADER_TEXTCOLOR')) {
         define('HEADER_TEXTCOLOR', '');
     }
     // No CSS, just IMG call. The %s is a placeholder for the theme template directory URI.
     if (!defined('HEADER_IMAGE')) {
         define('HEADER_IMAGE', '%s/i/headers/home-banner.jpg');
     }
     // The height and width of your custom header. You can hook into the theme's own filters to change these values.
     // Add a filter to danhuaer_header_image_width and danhuaer_header_image_height to change these values.
     define('HEADER_IMAGE_WIDTH', apply_filters('danhuaer_header_image_width', 1440));
     define('HEADER_IMAGE_HEIGHT', apply_filters('danhuaer_header_image_height', 198));
     // Don't support text inside the header image.
     if (!defined('NO_HEADER_TEXT')) {
         define('NO_HEADER_TEXT', true);
     }
     // Add a way for the custom header to be styled in the admin panel that controls
     // custom headers. See danhuaer_admin_header_style(), below.
     add_custom_image_header('', 'danhuaer_admin_header_style');
     // ... 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/i/headers/neihan-banner.jpg', 'thumbnail_url' => '%s/i/headers/neihan-banner.jpg', 'description' => __('Berries', 'danhuaer')), 'path' => array('url' => '%s/i/headers/home-banner.jpg', 'thumbnail_url' => '%s/i/headers/home-banner.jpg', 'description' => __('Path', 'danhuaer'))));
 }
Example #11
0
 /**
  * Sets up theme defaults and registers support for various WordPress and BuddyPress features.
  *
  * Note that this function is hooked into the after_setup_theme hook, which runs
  * before the init hook. The init hook is too late for some features, such as indicating
  * support post thumbnails.
  *
  * To override bp_dtheme_setup() in a child theme, add your own bp_dtheme_setup to your child theme's
  * functions.php file.
  *
  * @global object $bp Global BuddyPress settings object
  * @since 1.5
  */
 function bp_dtheme_setup()
 {
     global $bp;
     // Load the AJAX functions for the theme
     require STYLESHEETPATH . '/_inc/ajax.php';
     // 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');
     // Add default posts and comments RSS feed links to head
     add_theme_support('automatic-feed-links');
     // Add responsive layout support to bp-default without forcing child
     // themes to inherit it if they don't want to
     add_theme_support('bp-default-responsive');
     // This theme uses wp_nav_menu() in one location.
     register_nav_menus(array('primary' => __('Primary Navigation', 'buddypress')));
     // This theme allows users to set a custom background
     add_custom_background('bp_dtheme_custom_background_style');
     // Add custom header support if allowed
     if (!defined('BP_DTHEME_DISABLE_CUSTOM_HEADER')) {
         define('HEADER_TEXTCOLOR', 'FFFFFF');
         // The height and width of your custom header. You can hook into the theme's own filters to change these values.
         // Add a filter to bp_dtheme_header_image_width and bp_dtheme_header_image_height to change these values.
         define('HEADER_IMAGE_WIDTH', apply_filters('bp_dtheme_header_image_width', 1250));
         define('HEADER_IMAGE_HEIGHT', apply_filters('bp_dtheme_header_image_height', 133));
         // We'll be using post thumbnails for custom header images on posts and pages. We want them to be 1250 pixels wide by 133 pixels tall.
         // Larger images will be auto-cropped to fit, smaller ones will be ignored.
         set_post_thumbnail_size(HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true);
         // Add a way for the custom header to be styled in the admin panel that controls custom headers.
         add_custom_image_header('bp_dtheme_header_style', 'bp_dtheme_admin_header_style');
     }
     if (!is_admin()) {
         // Register buttons for the relevant component templates
         // Friends button
         if (bp_is_active('friends')) {
             add_action('bp_member_header_actions', 'bp_add_friend_button');
         }
         // Activity button
         if (bp_is_active('activity')) {
             add_action('bp_member_header_actions', 'bp_send_public_message_button');
         }
         // Messages button
         if (bp_is_active('messages')) {
             add_action('bp_member_header_actions', 'bp_send_private_message_button');
         }
         // Group buttons
         if (bp_is_active('groups')) {
             add_action('bp_group_header_actions', 'bp_group_join_button');
             add_action('bp_group_header_actions', 'bp_group_new_topic_button');
             add_action('bp_directory_groups_actions', 'bp_group_join_button');
         }
         // Blog button
         if (bp_is_active('blogs')) {
             add_action('bp_directory_blogs_actions', 'bp_blogs_visit_blog_button');
         }
     }
 }
Example #12
0
 /**
  * Sets up theme defaults and registers support for various WordPress features.
  *
  * Note that this function is hooked into the after_setup_theme hook, which runs
  * before the init hook. The init hook is too late for some features, such as indicating
  * support post thumbnails.
  *
  * To override twentyeleven_setup() in a child theme, add your own twentyeleven_setup to your child theme's
  * functions.php file.
  *
  * @uses load_theme_textdomain() For translation/localization support.
  * @uses add_editor_style() To style the visual editor.
  * @uses add_theme_support() To add support for post thumbnails, automatic feed links, and Post Formats.
  * @uses register_nav_menus() To add support for navigation menus.
  * @uses add_custom_background() To add support for a custom background.
  * @uses add_custom_image_header() To add support for a custom header.
  * @uses register_default_headers() To register the default custom header images provided with the theme.
  * @uses set_post_thumbnail_size() To set a custom post thumbnail size.
  *
  * @since Twenty Eleven 1.0
  */
 function twentyeleven_setup()
 {
     /* Make Twenty Eleven available for translation.
      * Translations can be added to the /languages/ directory.
      * If you're building a theme based on Twenty Eleven, use a find and replace
      * to change 'twentyeleven' to the name of your theme in all the template files.
      */
     load_theme_textdomain('twentyeleven', get_template_directory() . '/languages');
     $locale = get_locale();
     $locale_file = get_template_directory() . "/languages/{$locale}.php";
     if (is_readable($locale_file)) {
         require_once $locale_file;
     }
     // This theme styles the visual editor with editor-style.css to match the theme style.
     add_editor_style();
     // Load up our theme options page and related code.
     require get_template_directory() . '/inc/theme-options.php';
     // Grab Twenty Eleven's Ephemera widget.
     require get_template_directory() . '/inc/widgets.php';
     // Add default posts and comments RSS feed links to <head>.
     add_theme_support('automatic-feed-links');
     // This theme uses wp_nav_menu() in one location.
     register_nav_menu('primary', __('Primary Menu', 'twentyeleven'));
     // Add support for a variety of post formats
     add_theme_support('post-formats', array('aside', 'link', 'gallery', 'status', 'quote', 'image'));
     // Add support for custom backgrounds
     add_custom_background();
     // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page Custom Header images
     add_theme_support('post-thumbnails');
     // The next four constants set how Twenty Eleven supports custom headers.
     // The default header text color
     define('HEADER_TEXTCOLOR', '000');
     // By leaving empty, we allow for random image rotation.
     define('HEADER_IMAGE', '');
     // The height and width of your custom header.
     // Add a filter to twentyeleven_header_image_width and twentyeleven_header_image_height to change these values.
     define('HEADER_IMAGE_WIDTH', apply_filters('twentyeleven_header_image_width', 1000));
     define('HEADER_IMAGE_HEIGHT', apply_filters('twentyeleven_header_image_height', 110));
     // We'll be using post thumbnails for custom header images on posts and pages.
     // We want them to be the size of the header image that we just defined
     // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
     set_post_thumbnail_size(HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true);
     // Add Twenty Eleven's custom image sizes
     add_image_size('large-feature', HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true);
     // Used for large feature (header) images
     add_image_size('small-feature', 500, 300);
     // Used for featured posts if a large-feature doesn't exist
     // Turn on random header image rotation by default.
     add_theme_support('custom-header', array('random-default' => true));
     // Add a way for the custom header to be styled in the admin panel that controls
     // custom headers. See twentyeleven_admin_header_style(), below.
     add_custom_image_header('twentyeleven_header_style', 'twentyeleven_admin_header_style', 'twentyeleven_admin_header_image');
     // ... 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('wheel' => array('url' => '%s/images/headers/wheel.jpg', 'thumbnail_url' => '%s/images/headers/wheel-thumbnail.jpg', 'description' => __('Wheel', 'twentyeleven')), 'shore' => array('url' => '%s/images/headers/shore.jpg', 'thumbnail_url' => '%s/images/headers/shore-thumbnail.jpg', 'description' => __('Shore', 'twentyeleven')), 'trolley' => array('url' => '%s/images/headers/trolley.jpg', 'thumbnail_url' => '%s/images/headers/trolley-thumbnail.jpg', 'description' => __('Trolley', 'twentyeleven')), 'pine-cone' => array('url' => '%s/images/headers/pine-cone.jpg', 'thumbnail_url' => '%s/images/headers/pine-cone-thumbnail.jpg', 'description' => __('Pine Cone', 'twentyeleven')), 'chessboard' => array('url' => '%s/images/headers/chessboard.jpg', 'thumbnail_url' => '%s/images/headers/chessboard-thumbnail.jpg', 'description' => __('Chessboard', 'twentyeleven')), 'lanterns' => array('url' => '%s/images/headers/lanterns.jpg', 'thumbnail_url' => '%s/images/headers/lanterns-thumbnail.jpg', 'description' => __('Lanterns', 'twentyeleven')), 'willow' => array('url' => '%s/images/headers/willow.jpg', 'thumbnail_url' => '%s/images/headers/willow-thumbnail.jpg', 'description' => __('Willow', 'twentyeleven')), 'hanoi' => array('url' => '%s/images/headers/hanoi.jpg', 'thumbnail_url' => '%s/images/headers/hanoi-thumbnail.jpg', 'description' => __('Hanoi Plant', 'twentyeleven'))));
 }
 /**
  * Set up theme specific settings
  *
  * @uses add_theme_support() To add support for post thumbnails and automatic feed links.
  * @uses register_nav_menus() To add support for navigation menus.
  * @uses add_editor_style() To style the visual editor.
  * @uses load_theme_textdomain() For translation/localization support.
  * @uses add_image_size() To set custom image sizes.
  *
  * @since Esplanade 1.0
  */
 function esplanade_theme_setup()
 {
     // Set default content width based on the theme's layout. This affects the width of post images and embedded media.
     global $content_width;
     if (!isset($content_width)) {
         $content_width = 700;
     }
     // Automatically add feed links to document head
     add_theme_support('automatic-feed-links');
     // Register Primary Navigation Menu
     register_nav_menus(array('primary_nav' => 'Primary Menu'));
     // Add support for Post Formats
     add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat'));
     // Add support for post thumbnails and custom image sizes specific to theme locations
     add_theme_support('post-thumbnails', array('post'));
     add_image_size('slider-thumb', 640, 395, 1);
     add_image_size('blog-thumb', 268, 200, 1);
     add_image_size('teaser-thumb', 310, 190, 1);
     add_image_size('gallery-thumb', 100, 100, 1);
     add_image_size('video-thumb', 640, 395, 1);
     add_image_size('attachment-thumb', 700, 9999);
     // no crop flag, unlimited height
     if (esplanade_is_wp_version('3.4')) {
         // Allows users to set a custom background
         add_theme_support('custom-background');
         // Allows users to set a custom header image
         add_theme_support('custom-header', array('width' => 1082, 'height' => esplanade_get_option('header_image_height'), 'default-text-color' => '333', 'flex-height' => true, 'wp-head-callback' => 'esplanade_header_style', 'admin-head-callback' => 'esplanade_admin_header_style', 'admin-preview-callback' => 'esplanade_admin_header_image'));
     } else {
         // Allows users to set a custom background
         add_custom_background();
         // Allows users to set a custom header image
         if (!defined('HEADER_TEXTCOLOR')) {
             define('HEADER_TEXTCOLOR', '333');
         }
         // The height and width of your custom header.
         if (!defined('HEADER_IMAGE_WIDTH')) {
             define('HEADER_IMAGE_WIDTH', 1082);
         }
         if (!defined('HEADER_IMAGE_HEIGHT')) {
             define('HEADER_IMAGE_HEIGHT', esplanade_get_option('header_image_height'));
         }
         // Add a way for the custom header to be styled in the admin panel
         add_custom_image_header('esplanade_header_style', 'esplanade_admin_header_style', 'esplanade_admin_header_image');
     }
     // Styles the post editor
     add_editor_style();
     // Makes theme translation ready
     load_theme_textdomain('esplanade', get_template_directory() . '/languages');
     $locale = get_locale();
     $locale_file = get_template_directory() . "/languages/{$locale}.php";
     if (is_readable($locale_file)) {
         require_once $locale_file;
     }
 }
Example #14
0
function theme_setup()
{
    add_theme_support('automatic-feed-links');
    add_editor_style();
    add_custom_background();
    define('HEADER_TEXTCOLOR', '');
    define('HEADER_IMAGE', '');
    define('HEADER_IMAGE_WIDTH', apply_filters('autoshow_header_image_width', 988));
    define('HEADER_IMAGE_HEIGHT', apply_filters('autoshow_header_image_height', 300));
    define('NO_HEADER_TEXT', true);
    add_custom_image_header('', 'custom_admin_header_style');
}
Example #15
0
    /**
     *
     * @uses add_theme_support() To add support for post thumbnails and automatic feed links.
     * @uses register_nav_menus() To add support for navigation menus.
     *
     */
    function rt_base_setup()
    {
        // This theme uses post thumbnails
        add_theme_support('post-thumbnails');
        // Add default posts and comments RSS feed links to head
        add_theme_support('automatic-feed-links');
        // This theme styles the visual editor with editor-style.css to match the theme style.
        add_editor_style();
        /* custom background */
        add_custom_background();
        define('NO_HEADER_TEXT', true);
        $upload_dir = wp_upload_dir();
        define('RT_CACHE_DIR_PATH', $upload_dir['basedir'] . "/rt-cache/");
        define('RT_CACHE_DIR_URL', $upload_dir['baseurl'] . "/rt-cache/");
        define('HEADER_TEXTCOLOR', '');
        define('HEADER_IMAGE_WIDTH', 960);
        define('HEADER_IMAGE_HEIGHT', 109);
        /* adding support for the header image */
        add_custom_image_header('rt_header_style', 'rt_admin_header_style');
        if (!function_exists('rt_header_style')) {
            /* gets included in the admin header */
            function rt_admin_header_style()
            {
                ?>
                <style type="text/css">  #headimg { width: <?php 
                echo HEADER_IMAGE_WIDTH;
                ?>
px; height: <?php 
                echo HEADER_IMAGE_HEIGHT;
                ?>
px; } </style>
              <?php 
            }
        }
        /* Gets included in the site header */
        if (!function_exists('rt_header_style')) {
            function rt_header_style()
            {
                if (get_header_image()) {
                    ?>
                        <style type="text/css"> #header-wrapper { background: url(<?php 
                    header_image();
                    ?>
); } </style><?php 
                }
            }
        }
        // This theme uses wp_nav_menu() in one location.
        register_nav_menus(array('primary' => __('Primary Navigation')));
        //        Create rt_cache dir in upload
        wp_mkdir_p(RT_CACHE_DIR_PATH);
    }
function the_bootstrap_custom_header_setup()
{
    $args = apply_filters('the_bootstrap_custom_header_args', array('default-image' => '', 'width' => apply_filters('the_bootstrap_header_image_width', 1170), 'height' => apply_filters('the_bootstrap_header_image_height', 250), 'flex-height' => true, 'default-text-color' => '333333', 'wp-head-callback' => 'the_bootstrap_header_style', 'admin-head-callback' => 'the_bootstrap_admin_header_style', 'admin-preview-callback' => 'the_bootstrap_admin_header_image'));
    add_theme_support('custom-header', $args);
    if (!function_exists('wp_get_theme')) {
        // Compat: Versions of WordPress prior to 3.4.
        define('HEADER_TEXTCOLOR', $args['default-text-color']);
        define('HEADER_IMAGE', $args['default-image']);
        define('HEADER_IMAGE_WIDTH', $args['width']);
        define('HEADER_IMAGE_HEIGHT', $args['height']);
        add_custom_image_header($args['wp-head-callback'], $args['admin-head-callback'], $args['admin-preview-callback']);
    }
}
/**
 * Sample implementation of the Custom Header feature
 * http://codex.wordpress.org/Custom_Headers
 *
 * @package Sundance
 * @since Sundance 1.0
 */
function sundance_custom_header_setup()
{
    // The default header text color
    define('HEADER_TEXTCOLOR', '464646');
    // By leaving empty, we allow for random image rotation.
    define('HEADER_IMAGE', '');
    // The height and width of your custom header.
    // Add a filter to sundance_header_image_width and sundance_header_image_height to change these values.
    define('HEADER_IMAGE_WIDTH', apply_filters('sundance_header_image_width', 984));
    define('HEADER_IMAGE_HEIGHT', apply_filters('sundance_header_image_height', 242));
    // Add a way for the custom header to be styled in the admin panel that controls custom headers
    add_custom_image_header('sundance_header_style', 'sundance_admin_header_style', 'sundance_admin_header_image');
}
 /**
  * Setup for Parament Theme.
  */
 function parament_setup()
 {
     add_theme_support('automatic-feed-links');
     add_custom_background();
     define('HEADER_TEXTCOLOR', 'cccfd7');
     define('HEADER_IMAGE', '');
     /* Defaults to no header image. */
     define('HEADER_IMAGE_WIDTH', apply_filters('parament_header_image_width', 950));
     define('HEADER_IMAGE_HEIGHT', apply_filters('parament_header_image_height', 200));
     add_custom_image_header('parament_header_style', 'parament_admin_header_style', 'parament_admin_header_image');
     register_nav_menu('primary-menu', __('Primary', 'parament'));
     load_theme_textdomain('parament', get_template_directory() . '/languages');
     add_action('widgets_init', 'parament_register_sidebars');
 }
Example #19
0
 function wpzoom_setup()
 {
     define('HEADER_IMAGE', '%s/images/headers/mountain.jpg');
     define('NO_HEADER_TEXT', true);
     // The height and width of your custom header.
     define('HEADER_IMAGE_WIDTH', apply_filters('wpzoom_header_image_width', 1060));
     define('HEADER_IMAGE_HEIGHT', apply_filters('wpzoom_header_image_height', 326));
     // Add a way for the custom header to be styled in the admin panel that controls
     // custom headers. See wpzoom_admin_header_style(), below.
     add_custom_image_header('', 'wpzoom_admin_header_style', 'wpzoom_admin_header_image');
     // ... 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('mountain' => array('url' => '%s/images/headers/mountain.jpg', 'thumbnail_url' => '%s/images/headers/mountain-thumb.jpg', 'description' => __('Mountain', 'wpzoom')), 'balloon' => array('url' => '%s/images/headers/balloon.jpg', 'thumbnail_url' => '%s/images/headers/balloon-thumb.jpg', 'description' => __('Balloon', 'wpzoom')), 'balloon2' => array('url' => '%s/images/headers/balloon2.jpg', 'thumbnail_url' => '%s/images/headers/balloon2-thumb.jpg', 'description' => __('Balloon 2', 'wpzoom'))));
 }
Example #20
0
/**
 * Sets up theme defaults and registers the various WordPress features that
 * Twenty Twelve supports.
 *
 * @uses  load_theme_textdomain() For translation/localization support.
 * @uses  add_editor_style() To add a Visual Editor stylesheet.
 * @uses  add_theme_support() To add support for post thumbnails, automatic feed links,
 *    custom background, and post formats.
 * @uses  register_nav_menu() To add support for navigation menus.
 * @uses  set_post_thumbnail_size() To set a custom post thumbnail size.
 *
 * @since Twenty Twelve 1.0
 */
function twentytwelve_setup()
{
    /*
     * Makes Twenty Twelve available for translation.
     *
     * Translations can be added to the /languages/ directory.
     * If you're building a theme based on Twenty Twelve, use a find and replace
     * to change 'twentytwelve' to the name of your theme in all the template files.
     */
    load_theme_textdomain('twentytwelve', get_template_directory() . '/languages');
    // This theme styles the visual editor with editor-style.css to match the theme style.
    add_editor_style();
    // Adds RSS feed links to <head> for posts and comments.
    add_theme_support('automatic-feed-links');
    // This theme supports a variety of post formats.
    add_theme_support('post-formats', array('aside', 'image', 'link', 'quote', 'status'));
    /**
     * This theme uses wp_nav_menu() in one location.
     * register_nav_menu( 'primary', __( 'Primary Menu', 'twentytwelve' ) );
     * Deixar de lado o manu padrao e passar a usar um menu "nosso"
     */
    /*
     * This theme supports custom background color and image, and here
     * we also set up the default background color.
     */
    add_theme_support('custom-background', array('default-color' => 'e6e6e6'));
    // This theme uses a custom image size for featured images, displayed on "standard" posts.
    add_theme_support('post-thumbnails');
    set_post_thumbnail_size(624, 9999);
    // Unlimited height, soft crop
    // This theme allows users to set a custom background.
    add_theme_support('custom-background', array('default-color' => 'f1f1f1'));
    // The custom header business starts here.
    $custom_header_support = array('default-image' => '%s/img/cropped-banner.jpg', 'width' => apply_filters('twentytwelve_header_image_width', 1098), 'height' => apply_filters('twentytwelve_header_image_height', 198), 'flex-height' => true, 'header-text' => false, 'admin-head-callback' => 'twentytwelve_admin_header_style');
    add_theme_support('custom-header', $custom_header_support);
    if (!function_exists('get_custom_header')) {
        // This is all for compatibility with versions of WordPress prior to 3.4.
        define('HEADER_TEXTCOLOR', '');
        define('NO_HEADER_TEXT', true);
        define('HEADER_IMAGE', $custom_header_support['default-image']);
        define('HEADER_IMAGE_WIDTH', $custom_header_support['width']);
        define('HEADER_IMAGE_HEIGHT', $custom_header_support['height']);
        add_custom_image_header('', $custom_header_support['admin-head-callback']);
        add_custom_background();
    }
    // We'll be using post thumbnails for custom header images on posts and pages.
    // We want them to be 940 pixels wide by 198 pixels tall.
    // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
    set_post_thumbnail_size($custom_header_support['width'], $custom_header_support['height'], true);
}
Example #21
0
 function init()
 {
     if (function_exists('add_custom_image_header') and is_writable(K2_HEADERS_PATH)) {
         $styleinfo = get_style_data(get_option('k2scheme'));
         $header_image = get_option('k2header_picture');
         define('HEADER_IMAGE_HEIGHT', empty($styleinfo['header_height']) ? 200 : $styleinfo['header_height']);
         define('HEADER_IMAGE_WIDTH', empty($styleinfo['header_width']) ? 950 : $styleinfo['header_width']);
         define('HEADER_TEXTCOLOR', empty($styleinfo['header_text_color']) ? 'ffffff' : $styleinfo['header_text_color']);
         define('HEADER_IMAGE', empty($header_image) ? '%s/images/transparent.gif' : get_k2info('headers_url') . $header_image);
         add_custom_image_header(array('K2Header', 'output_header_css'), array('K2Header', 'output_admin_header_css'));
     } else {
         add_action('wp_head', array('K2Header', 'output_header_css'));
     }
 }
Example #22
0
 function twentyten_setup()
 {
     // This theme styles the visual editor with editor-style.css to match the theme style.
     add_editor_style();
     // Post Format support. You can also use the legacy "gallery" or "asides" (note the plural) categories.
     add_theme_support('post-formats', array('aside', 'gallery'));
     // This theme uses post thumbnails
     add_theme_support('post-thumbnails');
     // 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_theme_textdomain('twentyten', TEMPLATEPATH . '/languages');
     $locale = get_locale();
     $locale_file = TEMPLATEPATH . "/languages/{$locale}.php";
     if (is_readable($locale_file)) {
         require_once $locale_file;
     }
     // This theme uses wp_nav_menu() in one location.
     register_nav_menus(array('primary' => __('Primary Navigation', 'twentyten')));
     // This theme allows users to set a custom background
     add_custom_background();
     // Your changeable header business starts here
     if (!defined('HEADER_TEXTCOLOR')) {
         define('HEADER_TEXTCOLOR', '');
     }
     // No CSS, just IMG call. The %s is a placeholder for the theme template directory URI.
     if (!defined('HEADER_IMAGE')) {
         define('HEADER_IMAGE', '%s/images/headers/path.jpg');
     }
     // The height and width of your custom header. You can hook into the theme's own filters to change these values.
     // Add a filter to twentyten_header_image_width and twentyten_header_image_height to change these values.
     define('HEADER_IMAGE_WIDTH', apply_filters('twentyten_header_image_width', 940));
     define('HEADER_IMAGE_HEIGHT', apply_filters('twentyten_header_image_height', 198));
     // We'll be using post thumbnails for custom header images on posts and pages.
     // We want them to be 940 pixels wide by 198 pixels tall.
     // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
     set_post_thumbnail_size(HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true);
     // Don't support text inside the header image.
     if (!defined('NO_HEADER_TEXT')) {
         define('NO_HEADER_TEXT', true);
     }
     // Add a way for the custom header to be styled in the admin panel that controls
     // custom headers. See twentyten_admin_header_style(), below.
     add_custom_image_header('', 'twentyten_admin_header_style');
     // ... 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', 'twentyten')), 'cherryblossom' => array('url' => '%s/images/headers/cherryblossoms.jpg', 'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg', 'description' => __('Cherry Blossoms', 'twentyten')), 'concave' => array('url' => '%s/images/headers/concave.jpg', 'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg', 'description' => __('Concave', 'twentyten')), 'fern' => array('url' => '%s/images/headers/fern.jpg', 'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg', 'description' => __('Fern', 'twentyten')), 'forestfloor' => array('url' => '%s/images/headers/forestfloor.jpg', 'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg', 'description' => __('Forest Floor', 'twentyten')), 'inkwell' => array('url' => '%s/images/headers/inkwell.jpg', 'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg', 'description' => __('Inkwell', 'twentyten')), 'path' => array('url' => '%s/images/headers/path.jpg', 'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg', 'description' => __('Path', 'twentyten')), 'sunset' => array('url' => '%s/images/headers/sunset.jpg', 'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg', 'description' => __('Sunset', 'twentyten'))));
 }
Example #23
0
/**
 * Setup the WordPress core custom header feature.
 *
 * Use add_theme_support to register support for WordPress 3.4+
 * as well as provide backward compatibility for previous versions.
 * Use feature detection of wp_get_theme() which was introduced
 * in WordPress 3.4.
 *
 * @todo Rework this function to remove WordPress 3.4 support when WordPress 3.6 is released.
 *
 * @uses _s_header_style()
 * @uses _s_admin_header_style()
 * @uses _s_admin_header_image()
 *
 * @package _s
 */
function _s_custom_header_setup()
{
    $args = array('default-image' => '', 'default-text-color' => '000', 'width' => 1000, 'height' => 250, 'flex-height' => true, 'wp-head-callback' => '_s_header_style', 'admin-head-callback' => '_s_admin_header_style', 'admin-preview-callback' => '_s_admin_header_image');
    $args = apply_filters('_s_custom_header_args', $args);
    if (function_exists('wp_get_theme')) {
        add_theme_support('custom-header', $args);
    } else {
        // Compat: Versions of WordPress prior to 3.4.
        define('HEADER_TEXTCOLOR', $args['default-text-color']);
        define('HEADER_IMAGE', $args['default-image']);
        define('HEADER_IMAGE_WIDTH', $args['width']);
        define('HEADER_IMAGE_HEIGHT', $args['height']);
        add_custom_image_header($args['wp-head-callback'], $args['admin-head-callback'], $args['admin-preview-callback']);
    }
}
/**
* Sample implementation of the Custom Header feature
* http://codex.wordpress.org/Custom_Headers
*
* You can add an optional custom header image to header.php like so ...

	<?php $header_image = get_header_image();
	if ( ! empty( $header_image ) ) { ?>
		<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
			<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
		</a>
	<?php } // if ( ! empty( $header_image ) ) ?>

*
* @package _s
* @since _s 1.0
*/
function _s_custom_header_setup()
{
    // The default header text color
    define('HEADER_TEXTCOLOR', '000');
    // By leaving empty, we allow for random image rotation.
    define('HEADER_IMAGE', '');
    // The height and width of your custom header.
    // Add a filter to _s_header_image_width and _s_header_image_height to change these values.
    define('HEADER_IMAGE_WIDTH', apply_filters('_s_header_image_width', 1000));
    define('HEADER_IMAGE_HEIGHT', apply_filters('_s_header_image_height', 250));
    // Turn on random header image rotation by default.
    add_theme_support('custom-header', array('random-default' => true));
    // Add a way for the custom header to be styled in the admin panel that controls custom headers
    add_custom_image_header('_s_header_style', '_s_admin_header_style', '_s_admin_header_image');
}
Example #25
0
/**
 * Setup the WordPress core custom header feature.
 *
 * Use add_theme_support to register support for WordPress 3.4+
 * as well as provide backward compatibility for previous versions.
 * Use feature detection of wp_get_theme() which was introduced
 * in WordPress 3.4.
 *
 * @uses pachyderm_header_style()
 * @uses pachyderm_admin_header_style()
 * @uses pachyderm_admin_header_image()
 *
 * @package Going to the Zoo
 */
function pachyderm_custom_header_setup()
{
    $args = array('default-image' => get_template_directory_uri() . '/img/zoo.png', 'default-text-color' => '49352f', 'width' => 790, 'height' => 200, 'flex-height' => true, 'flex-width' => true, 'wp-head-callback' => 'pachyderm_header_style', 'admin-head-callback' => 'pachyderm_admin_header_style', 'admin-preview-callback' => 'pachyderm_admin_header_image');
    $args = apply_filters('pachyderm_custom_header_args', $args);
    if (function_exists('wp_get_theme')) {
        add_theme_support('custom-header', $args);
    } else {
        // Compat: Versions of WordPress prior to 3.4.
        define('HEADER_TEXTCOLOR', $args['default-text-color']);
        define('HEADER_IMAGE', $args['default-image']);
        define('HEADER_IMAGE_WIDTH', $args['width']);
        define('HEADER_IMAGE_HEIGHT', $args['height']);
        add_custom_image_header($args['wp-head-callback'], $args['admin-head-callback'], $args['admin-preview-callback']);
    }
}
Example #26
0
/**
 * Setup the WordPress core custom header arguments and settings.
 *
 * Use add_theme_support() to register support for WordPress 3.4+
 * as well as provide backward compatibility for previous versions.
 *
 * Use feature detection of wp_get_theme() which was introduced
 * in WordPress 3.4.
 *
 * @uses twentytwelve_header_style()
 * @uses twentytwelve_admin_header_style()
 * @uses twentytwelve_admin_header_image()
 *
 * @package Twenty_Twelve
 */
function twentytwelve_custom_header_setup()
{
    $args = array('default-text-color' => '444', 'default-image' => '', 'height' => 250, 'width' => 960, 'max-width' => 2000, 'flex-height' => true, 'flex-width' => true, 'random-default' => false, 'wp-head-callback' => 'twentytwelve_header_style', 'admin-head-callback' => 'twentytwelve_admin_header_style', 'admin-preview-callback' => 'twentytwelve_admin_header_image');
    // Allow child themes to filter any of these arguments.
    $args = apply_filters('twentytwelve_custom_header_args', $args);
    if (function_exists('wp_get_theme')) {
        add_theme_support('custom-header', $args);
    } else {
        // Back compat for < 3.4 versions.
        define('HEADER_TEXTCOLOR', $args['default-text-color']);
        define('HEADER_IMAGE', $args['default-image']);
        define('HEADER_IMAGE_WIDTH', $args['width']);
        define('HEADER_IMAGE_HEIGHT', $args['height']);
        add_custom_image_header($args['wp-head-callback'], $args['admin-head-callback'], $args['admin-preview-callback']);
    }
}
 /**
  * Sets up theme defaults and registers support for various WordPress features.
  *
  * Note that this function is hooked into the after_setup_theme hook, which runs
  * before the init hook. The init hook is too late for some features, such as indicating
  * support post thumbnails.
  *
  * To override pilcrow_setup() in a child theme, add your own pilcrow_setup to your child theme's
  * functions.php file.
  *
  * @uses add_theme_support() To add support for post thumbnails and automatic feed links.
  * @uses register_nav_menus() To add support for navigation menus.
  * @uses add_custom_background() To add support for a custom background.
  * @uses add_editor_style() To style the visual editor.
  * @uses load_theme_textdomain() For translation/localization support.
  * @uses add_custom_image_header() To add support for a custom header.
  * @uses register_default_headers() To register the default custom header images provided with the theme.
  * @uses set_post_thumbnail_size() To set a custom post thumbnail size.
  *
  * @since Pilcrow 1.0
  */
 function pilcrow_setup()
 {
     // This theme has some pretty cool theme options
     require dirname(__FILE__) . '/inc/theme-options.php';
     // This theme uses post thumbnails
     add_theme_support('post-thumbnails');
     // 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_theme_textdomain('pilcrow', get_template_directory() . '/languages');
     $locale = get_locale();
     $locale_file = get_template_directory() . "/languages/{$locale}.php";
     if (is_readable($locale_file)) {
         require_once $locale_file;
     }
     // This theme uses wp_nav_menu() in one location.
     register_nav_menus(array('primary' => __('Primary Navigation', 'pilcrow')));
     // This theme allows users to set a custom background
     add_custom_background();
     // Your changeable header business starts here
     define('HEADER_TEXTCOLOR', '000');
     // No CSS, just IMG call. The %s is a placeholder for the theme template directory URI.
     define('HEADER_IMAGE', '%s/images/headers/books.jpg');
     // The height and width of your custom header. You can hook into the theme's own filters to change these values.
     // Add a filter to pilcrow_header_image_width and pilcrow_header_image_height to change these values.
     $options = pilcrow_get_theme_options();
     $current_layout = $options['theme_layout'];
     $two_columns = array('content-sidebar', 'sidebar-content');
     if (in_array($current_layout, $two_columns)) {
         define('HEADER_IMAGE_WIDTH', apply_filters('pilcrow_header_image_width', 770));
         define('HEADER_IMAGE_HEIGHT', apply_filters('pilcrow_header_image_height', 200));
     } else {
         define('HEADER_IMAGE_WIDTH', apply_filters('pilcrow_header_image_width', 990));
         define('HEADER_IMAGE_HEIGHT', apply_filters('pilcrow_header_image_height', 257));
     }
     // We'll be using post thumbnails for custom header images on posts and pages.
     // We want them to be 940 pixels wide by 198 pixels tall.
     // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
     set_post_thumbnail_size(HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true);
     // Add a way for the custom header to be styled in the admin panel that controls
     // custom headers. See pilcrow_admin_header_style(), below.
     add_custom_image_header('pilcrow_header_style', 'pilcrow_admin_header_style', 'pilcrow_admin_header_image');
     // ... 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('books' => array('url' => '%s/images/headers/books.jpg', 'thumbnail_url' => '%s/images/headers/books-thumbnail.jpg', 'description' => __('Books', 'pilcrow')), 'record' => array('url' => '%s/images/headers/record.jpg', 'thumbnail_url' => '%s/images/headers/record-thumbnail.jpg', 'description' => __('Record', 'pilcrow')), 'pattern' => array('url' => '%s/images/headers/pattern.jpg', 'thumbnail_url' => '%s/images/headers/pattern-thumbnail.jpg', 'description' => __('Pattern', 'pilcrow'))));
 }
function holydesert_customheader_setup()
{
    define('HEADER_TEXTCOLOR', '');
    define('HEADER_IMAGE', '%s/images/painted-desert.jpg');
    // %s is the template dir uri
    define('HEADER_IMAGE_WIDTH', 900);
    // use width and height appropriate for your theme
    define('HEADER_IMAGE_HEIGHT', 180);
    define('NO_HEADER_TEXT', true);
    //Gets included in the site header
    function header_style()
    {
        ?>
<style type="text/css">
        #header {
          background: url(<?php 
        header_image();
        ?>
);
        }
      </style>
    <?php 
    }
    //Gets included in the admin header
    function admin_header_style()
    {
        ?>
<style type="text/css">
        #headimg {
          width: <?php 
        echo HEADER_IMAGE_WIDTH;
        ?>
px;
          height: <?php 
        echo HEADER_IMAGE_HEIGHT;
        ?>
px;
        }
      </style>
    <?php 
    }
    header_style();
    admin_header_style();
    add_custom_image_header('header_style', 'admin_header_style');
    //Register Default Header Images
    register_default_headers(array('painted-desert' => array('url' => '%s/images/painted-desert.jpg', 'thumbnail_url' => '%s/images/painted-desert_thumb.jpg', 'description' => __('Painted Desert', 'holydesert')), 'green-forest' => array('url' => '%s/images/green-forest.jpg', 'thumbnail_url' => '%s/images/green-forest_thumb.jpg', 'description' => __('Green Forest', 'holydesert')), 'w900h180' => array('url' => '%s/images/w900h180.jpg', 'thumbnail_url' => '%s/images/w900h180_thumb.jpg', 'description' => __('Width=900 Height=180', 'holydesert'))));
}
function theme_setup()
{
    global $wp_version;
    if (version_compare($wp_version, '3.4', '>=')) {
        add_theme_support('custom-header', array('default-image' => get_template_directory_uri() . '/images/icons/bolt_large.png', 'header-text' => false, 'default-text-color' => '000', 'width' => '100', 'flex-width' => true, 'height' => '100', 'flex-height' => true, 'random-default' => true, 'wp-head-callback' => 'theme_header_style', 'admin-head-callback' => 'theme_admin_header_style', 'admin-preview-callback' => 'theme_admin_header_image'));
    } else {
        add_theme_support('custom-header', array('random-default' => true));
        //WP Custom Header - random roation by default
        define('HEADER_TEXTCOLOR', '');
        define('HEADER_IMAGE', '%s/images/icons/bolt_large.png');
        define('HEADER_IMAGE_HEIGHT', '100');
        define('HEADER_IMAGE_WIDTH', '100');
        define('NO_HEADER_TEXT', true);
        add_custom_image_header('theme_header_style', 'theme_admin_header_style', 'theme_admin_header_image');
    }
    register_default_headers(array('atom' => array('url' => '%s/images/icons/atom_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/atom.png', 'description' => 'atom'), 'bear' => array('url' => '%s/images/icons/bear_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/bear.png', 'description' => 'bear'), 'bolt' => array('url' => '%s/images/icons/bolt_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/bolt.png', 'description' => 'bolt'), 'bullhorn' => array('url' => '%s/images/icons/bullhorn_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/bullhorn.png', 'description' => 'bullhorn'), 'business_man' => array('url' => '%s/images/icons/business_man_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/business_man.png', 'description' => 'business_man'), 'cassette' => array('url' => '%s/images/icons/cassette_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/cassette.png', 'description' => 'cassette'), 'cell_phone' => array('url' => '%s/images/icons/cell_phone_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/cell_phone.png', 'description' => 'cell_phone'), 'chain_link' => array('url' => '%s/images/icons/chain_link_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/chain_link.png', 'description' => 'chain_link'), 'coffee' => array('url' => '%s/images/icons/coffee_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/coffee.png', 'description' => 'coffee'), 'cog_head' => array('url' => '%s/images/icons/cog_head_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/cog_head.png', 'description' => 'cog_head'), 'day_night' => array('url' => '%s/images/icons/day_night_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/day_night.png', 'description' => 'day_night'), 'disapprove' => array('url' => '%s/images/icons/disapprove_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/disapprove.png', 'description' => 'disapprove'), 'dog' => array('url' => '%s/images/icons/dog_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/dog.png', 'description' => 'dog'), 'eye' => array('url' => '%s/images/icons/eye_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/eye.png', 'description' => 'eye'), 'film' => array('url' => '%s/images/icons/film_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/film.png', 'description' => 'film'), 'flask' => array('url' => '%s/images/icons/flask_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/flask.png', 'description' => 'flask'), 'ghost' => array('url' => '%s/images/icons/ghost_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/ghost.png', 'description' => 'ghost'), 'glasses' => array('url' => '%s/images/icons/glasses_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/glasses.png', 'description' => 'glasses'), 'hat' => array('url' => '%s/images/icons/hat_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/hat.png', 'description' => 'hat'), 'heart' => array('url' => '%s/images/icons/heart_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/heart.png', 'description' => 'heart'), 'infection' => array('url' => '%s/images/icons/infection_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/infection.png', 'description' => 'infection'), 'infinity' => array('url' => '%s/images/icons/infinity_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/infinity.png', 'description' => 'infinity'), 'iphone' => array('url' => '%s/images/icons/iphone_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/iphone.png', 'description' => 'iphone'), 'like' => array('url' => '%s/images/icons/like_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/like.png', 'description' => 'like'), 'man_stairs' => array('url' => '%s/images/icons/man_stairs_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/man_stairs.png', 'description' => 'man_stairs'), 'mine_cross' => array('url' => '%s/images/icons/mine_cross_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/mine_cross.png', 'description' => 'mine_cross'), 'motorcycle' => array('url' => '%s/images/icons/motorcycle_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/motorcycle.png', 'description' => 'motorcycle'), 'no_smoking' => array('url' => '%s/images/icons/no_smoking_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/no_smoking.png', 'description' => 'no_smoking'), 'pan_ui' => array('url' => '%s/images/icons/pan_ui_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/pan_ui.png', 'description' => 'pan_ui'), 'radio' => array('url' => '%s/images/icons/radio_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/radio.png', 'description' => 'radio'), 'paperplane' => array('url' => '%s/images/icons/paperplane_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/paperplane.png', 'description' => 'radio'), 'robot_square' => array('url' => '%s/images/icons/robot_square_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/robot_square.png', 'description' => 'robot_square'), 'soccer_shoe' => array('url' => '%s/images/icons/soccer_shoe_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/soccer_shoe.png', 'description' => 'soccer_shoe'), 'automobile' => array('url' => '%s/images/icons/automobile_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/automobile.png', 'description' => 'automobile'), 'guitar' => array('url' => '%s/images/icons/guitar_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/guitar.png', 'description' => 'guitar'), 'acting' => array('url' => '%s/images/icons/acting_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/acting.png', 'description' => 'acting'), 'cloudrain' => array('url' => '%s/images/icons/cloudrain_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/cloudrain.png', 'description' => 'cloudrain'), 'whale' => array('url' => '%s/images/icons/whale_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/whale.png', 'description' => 'whale'), 'money' => array('url' => '%s/images/icons/money_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/money.png', 'description' => 'money'), 'sunrise' => array('url' => '%s/images/icons/sunrise_large.png', 'thumbnail_url' => '%s/images/icons/thumbs/sunrise.png', 'description' => 'sunrise')));
}
Example #30
0
function manifesto_setup()
{
    // This theme uses post thumbnails
    add_theme_support('post-thumbnails');
    add_theme_support('automatic-feed-links');
    add_image_size('feature_image_size', 498, 999);
    register_nav_menus(array('header_menu' => "Header Menu"));
    register_nav_menus(array('footer_menu' => "Footer Menu"));
    define('NO_HEADER_TEXT', 'true');
    define('HEADER_TEXTCOLOR', '');
    define('HEADER_IMAGE', '%s/images/default_header.jpg');
    // %s is the template dir uri
    define('HEADER_IMAGE_WIDTH', 225);
    // use width and height appropriate for your theme
    define('HEADER_IMAGE_HEIGHT', 240);
    add_custom_image_header('manifesto_header_style', 'manifesto_admin_header_style');
}