当前位置: 首页>>代码示例>>PHP>>正文


PHP add_custom_image_header函数代码示例

本文整理汇总了PHP中add_custom_image_header函数的典型用法代码示例。如果您正苦于以下问题:PHP add_custom_image_header函数的具体用法?PHP add_custom_image_header怎么用?PHP add_custom_image_header使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了add_custom_image_header函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: bones_setup

 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.
     }
 }
开发者ID:robv,项目名称:bones,代码行数:28,代码来源:functions.php

示例2: yoko

 /**
  * 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'))));
 }
开发者ID:joaosigno,项目名称:dazake-job,代码行数:38,代码来源:functions.php

示例3: bouquet_setup

 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'));
 }
开发者ID:kevinreilly,项目名称:mendelements.com,代码行数:29,代码来源:functions.php

示例4: pinktouch_setup

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');
}
开发者ID:kevinreilly,项目名称:mendelements.com,代码行数:27,代码来源:functions.php

示例5: next_saturday_setup

/**
 * 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' );

}
开发者ID:kevinreilly,项目名称:mendelements.com,代码行数:34,代码来源:functions.php

示例6: onemozilla_setup

 /**
  * 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'));
     }
 }
开发者ID:guspit,项目名称:One-Mozilla-blog,代码行数:76,代码来源:functions.php

示例7: classblogging_setup

/**
 * 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;
    }
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:31,代码来源:functions.php

示例8: techozoic_setup

/**
 * 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'))));
}
开发者ID:ruby4web,项目名称:Techozoic-Fluid,代码行数:41,代码来源:functions.php

示例9: twentyten_setup

 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');
 }
开发者ID:beaucollins,项目名称:jl,代码行数:28,代码来源:functions.php

示例10: danhuaer_setup

 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'))));
 }
开发者ID:nicevoice,项目名称:Danhuaer_wordpress_theme,代码行数:35,代码来源:functions.php

示例11: bp_dtheme_setup

 /**
  * 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');
         }
     }
 }
开发者ID:hscale,项目名称:webento,代码行数:70,代码来源:functions.php

示例12: twentyeleven_setup

 /**
  * 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'))));
 }
开发者ID:scattenlaeufer,项目名称:neurotheme,代码行数:77,代码来源:functions.php

示例13: esplanade_theme_setup

 /**
  * 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;
     }
 }
开发者ID:JerryXie96,项目名称:PBSMUNC2013WebSite,代码行数:65,代码来源:functions.php

示例14: theme_setup

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');
}
开发者ID:besimhu,项目名称:legacy,代码行数:12,代码来源:functions.php

示例15: rt_base_setup

    /**
     *
     * @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);
    }
开发者ID:rtCamp,项目名称:rtmoto,代码行数:58,代码来源:rt-init.php


注:本文中的add_custom_image_header函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。