本文整理汇总了PHP中add_custom_background函数的典型用法代码示例。如果您正苦于以下问题:PHP add_custom_background函数的具体用法?PHP add_custom_background怎么用?PHP add_custom_background使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_custom_background函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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'))));
}
示例2: indoor_setup
function indoor_setup()
{
/*
* Registers a new image size
* 1. parameter - name of the image size
* 2. parameter - picture width
* 3. parameter - picture height
* 4. parameter - crop (true or false)
*
* uncomment the line if you want to use it
*/
add_image_size('slider', 920, 398, true);
/*
* activate the blank_meta function
*/
//add_action('xtreme_meta', 'indoor_meta');
// This theme allows users to set a custom background
// ATTENTION: WordPress 3.4 deprecates some functions, thatswhy this test
if (version_compare($GLOBALS['wp_version'], '3.4a', '>=')) {
add_theme_support('custom-background', array());
} else {
add_custom_background();
}
/* change the size of the post thumnail in loop */
add_filter('xtreme_loop_thumbnail_size', 'indoor_thumbnail_size');
}
示例3: admired_setup
function admired_setup()
{
// Available for translation.
load_theme_textdomain('admired', 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_editor_style();
// Style the visual editor.
add_theme_support('automatic-feed-links');
register_nav_menus(array('primary' => __('Primary Navigation', 'admired'), 'secondary' => __('Secondary Navigation - Top', 'admired')));
// Post formats
add_theme_support('post-formats', array('aside', 'link', 'gallery', 'status', 'quote', 'image'));
// Custom Backgrounds
if (function_exists('get_custom_header')) {
// WordPress 3.4+
add_theme_support('custom-background');
} else {
// Backwards Compatibility
add_custom_background();
}
add_theme_support('post-thumbnails');
}
示例4: 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' );
}
示例5: prototype_theme_setup
/**
* Theme setup function. This function adds support for theme features and defines the default theme
* actions and filters.
*
* @since 0.1.0
*/
function prototype_theme_setup()
{
/* Get action/filter hook prefix. */
$prefix = hybrid_get_prefix();
/* Add theme support for core framework features. */
add_theme_support('hybrid-core-menus', array('primary', 'secondary', 'subsidiary'));
add_theme_support('hybrid-core-sidebars', array('primary', 'secondary', 'header', 'subsidiary', 'after-singular'));
add_theme_support('hybrid-core-widgets');
add_theme_support('hybrid-core-shortcodes');
add_theme_support('hybrid-core-theme-settings', array('about', 'footer'));
add_theme_support('hybrid-core-drop-downs');
add_theme_support('hybrid-core-seo');
add_theme_support('hybrid-core-template-hierarchy');
/* Add theme support for framework extensions. */
add_theme_support('theme-layouts', array('1c', '2c-l', '2c-r', '3c-l', '3c-r', '3c-c'));
add_theme_support('post-stylesheets');
add_theme_support('dev-stylesheet');
add_theme_support('loop-pagination');
add_theme_support('get-the-image');
add_theme_support('breadcrumb-trail');
add_theme_support('cleaner-gallery');
/* Add theme support for WordPress features. */
add_theme_support('automatic-feed-links');
add_custom_background();
/* Add the search form to the secondary menu. */
add_action("{$prefix}_close_menu_secondary", 'get_search_form');
/* Embed width/height defaults. */
add_filter('embed_defaults', 'prototype_embed_defaults');
/* Filter the sidebar widgets. */
add_filter('sidebars_widgets', 'prototype_disable_sidebars');
add_action('template_redirect', 'prototype_one_column');
/* Set the content width. */
hybrid_set_content_width(600);
}
示例6: patchwork_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.
*
* @since Patchwork 1.0
*/
function patchwork_setup()
{
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Custom functions that act independently of the theme templates
*/
require get_template_directory() . '/inc/tweaks.php';
/**
* Custom Theme Options
*/
require get_template_directory() . '/inc/theme-options/theme-options.php';
/**
* WordPress.com-specific functions and definitions
*/
//require( get_template_directory() . '/inc/wpcom.php' );
/* Jetpack Infinite Scroll */
add_theme_support('infinite-scroll', array('container' => 'content', 'footer' => 'main', 'footer_widgets' => 'infinite_scroll_has_footer_widgets'));
function infinite_scroll_has_footer_widgets()
{
if (jetpack_is_mobile('', true) && is_active_sidebar('sidebar-1')) {
return true;
}
return false;
}
/**
* Make theme available for translation
* Translations can be filed in the /languages/ directory
* If you're building a theme based on Patchwork, use a find and replace
* to change 'patchwork' to the name of your theme in all the template files
*/
load_theme_textdomain('patchwork', 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', 'patchwork')));
/**
* Add support for custom backgrounds
*/
$args = array('default-color' => 'ece8de', 'default-image' => get_template_directory_uri() . '/images/texture.png');
$args = apply_filters('patchwork_custom_background_args', $args);
if (function_exists('wp_get_theme')) {
add_theme_support('custom-background', $args);
} else {
define('BACKGROUND_COLOR', $args['default-color']);
define('BACKGROUND_IMAGE', $args['default-image']);
add_custom_background();
}
}
示例7: qc_setup
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @since Quality Control 0.1
* @global array $qc_options User-defined settings.
*/
function qc_setup()
{
global $qc_options;
$qc_options = new scbOptions('qc_options', false, array('assigned_perms' => 'protected', 'ticket_status_new' => false, 'ticket_status_closed' => false, 'repository' => array()));
require dirname(__FILE__) . '/includes/classes/qc-taxonomy.php';
require dirname(__FILE__) . '/includes/modules/states.php';
require dirname(__FILE__) . '/includes/special-pages.php';
require dirname(__FILE__) . '/includes/widgets.php';
require dirname(__FILE__) . '/includes/template-tags.php';
require dirname(__FILE__) . '/includes/tickets.php';
require dirname(__FILE__) . '/includes/comments.php';
require dirname(__FILE__) . '/includes/theme-header.php';
require dirname(__FILE__) . '/includes/theme-footer.php';
add_theme_support('ticket-priorities');
add_theme_support('ticket-milestones');
add_theme_support('ticket-tags');
add_theme_support('ticket-categories');
add_theme_support('ticket-attachments');
add_theme_support('ticket-assignment');
add_theme_support('ticket-notifications');
add_theme_support('changesets');
add_theme_support('automatic-feed-links');
add_custom_background();
add_editor_style();
register_sidebar(array('name' => __('Primary Widget Area', APP_TD), 'id' => 'primary-widget-area', 'description' => __('The primary widget area', APP_TD), 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
appthemes_load_textdomain();
if (is_admin()) {
require dirname(__FILE__) . '/includes/admin/dashboard.php';
require dirname(__FILE__) . '/includes/admin/options.php';
require dirname(__FILE__) . '/includes/admin/admin.php';
}
}
示例8: minimalist_setup
function minimalist_setup()
{
/*
* Registers a new image size
* 1. parameter - name of the image size
* 2. parameter - picture width
* 3. parameter - picture height
* 4. parameter - crop (true or false)
*
* the image size for index, archive etc.
*/
add_image_size('featured', 284, 84, true);
// the image size for the sliders
add_image_size('slider', 928, 250, true);
//add meta data - see function minimalist_meta below
//add_action('xtreme_meta', 'minimalist_meta');
//remove authorbox on single view
//remove_action('xtreme_after_single_post', 'xtreme_author_box', 2);
// This theme allows users to set a custom background
// ATTENTION: WordPress 3.4 deprecates some functions, thatswhy this test
global $wp_version;
if (version_compare($wp_version, '3.4a', '>=')) {
add_theme_support('custom-background', array());
} else {
add_custom_background();
}
}
示例9: grisaille_setup_theme
function grisaille_setup_theme()
{
add_theme_support('automatic-feed-links');
/**
* Add Menu Support
**/
register_nav_menu('main', 'Primary Navigation');
/**
* Add editor style - recommended according to Theme-Check
**/
add_editor_style();
// Custom backgrounds support
$args = array('default-color' => 'efedee', 'default-image' => get_template_directory_uri() . '/images/background.jpg');
$args = apply_filters('grisaille_custom_background_args', $args);
if (function_exists('wp_get_theme')) {
add_theme_support('custom-background', $args);
} else {
define('BACKGROUND_COLOR', $args['default-color']);
define('BACKGROUND_IMAGE', $args['default-image']);
add_custom_background();
}
/**
* Thumbnail support
**/
add_theme_support('post-thumbnails');
set_post_thumbnail_size(590, 275, true);
// 590 pixels wide by 275 pixels tall, hard crop mode
add_image_size('following-post-thumbnails', 250, 200, true);
// 250 pixels wide by 200 pixels tall, hard crop mode
}
示例10: flexishop_setup
function flexishop_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');
// 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('flexishop', 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', 'flexishop')));
// This theme allows users to set a custom background
add_custom_background();
define('HEADER_TEXTCOLOR', '');
define('HEADER_IMAGE_WIDTH', apply_filters('flexishop_header_image_width', 75));
define('HEADER_IMAGE_HEIGHT', apply_filters('flexishop_header_image_height', 75));
// 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_image_size('promotion', 980, 375, true);
// Feature size
add_image_size('blog', 690, 282, true);
// Feature Blog Size
// Don't support text inside the header image.
define('NO_HEADER_TEXT', true);
}
示例11: minileven_setup
/**
* Sets up theme defaults and registers support for various WordPress features.
*/
function minileven_setup()
{
global $wp_version;
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Custom functions that act independently of the theme templates
*/
require get_template_directory() . '/inc/tweaks.php';
/* Make Minileven available for translation.
* Translations can be added to the /languages/ directory.
* If you're building a theme based on Minileven, use a find and replace
* to change 'minileven' to the name of your theme in all the template files.
*/
load_theme_textdomain('minileven', TEMPLATEPATH . '/languages');
// 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', 'jetpack'));
// Add support for a variety of post formats
add_theme_support('post-formats', array('gallery'));
// Add support for custom backgrounds
if (version_compare($wp_version, '3.4', '>=')) {
add_theme_support('custom-background');
} else {
add_custom_background();
}
// Add support for post thumbnails
add_theme_support('post-thumbnails');
}
示例12: vintagefolio_setup
function vintagefolio_setup()
{
/*
* Registers a new image size
* 1. parameter - name of the image size
* 2. parameter - picture width
* 3. parameter - picture height
* 4. parameter - crop (true or false)
*
* uncomment the line if you want to use it
*/
add_image_size('slider', 910, 300, true);
add_image_size('featured', 587, 140, true);
add_image_size('sidebar', 263, 80, true);
/*
* activate the vintagefolio_meta function
*/
//add_action('xtreme_meta', 'vintagefolio_meta');
// This theme allows users to set a custom background
// ATTENTION: WordPress 3.4 deprecates some functions, thatswhy this test
global $wp_version;
if (version_compare($wp_version, '3.4a', '>=')) {
add_theme_support('custom-background', array());
} else {
add_custom_background();
}
add_filter('xtreme_loop_thumbnail_size', 'vintagefolio_index_image_size');
add_filter('xtreme_loop_thumbnail_align', 'vintagefolio_index_image_align');
/*
* activate post formats
*/
//add_theme_support('post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote', 'image', 'video', 'audio', 'chat' ) );
}
示例13: ashford_background
/**
* Add custom background (not mobi)
*
* @author Tim Bednar
* @version v2.0
* @since v2.0
*/
function ashford_background()
{
// Background support
if (function_exists('add_custom_background') && IS_MOBI == 'false') {
add_custom_background();
}
}
示例14: quality_setup
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @since Quality Control 0.1
*/
function quality_setup()
{
global $quality_options;
$quality_options = get_option('quality_options');
// Add default posts and comments RSS feed links to head
add_theme_support('automatic-feed-links');
// Add support for custom backgrounds... Why not?
add_custom_background();
// Make the editor more "What you get"
add_editor_style();
// This theme uses wp_nav_menu() in one location.
register_nav_menus(array('primary' => __('Primary Navigation', 'quality')));
// Make theme available for translation
load_theme_textdomain('quality', TEMPLATEPATH . '/languages');
$locale = get_locale();
$locale_file = TEMPLATEPATH . "/languages/{$locale}.php";
if (is_readable($locale_file)) {
require_once $locale_file;
}
if (!is_admin()) {
wp_enqueue_script('jquery');
wp_enqueue_script('custom', QC_JS_URL . '/jquery.custom.js');
}
// Require other files, to keep things organized.
require_once QC_INC_PATH . '/options.php';
require_once QC_INC_PATH . '/tickets.php';
require_once QC_INC_PATH . '/updates.php';
require_once QC_INC_PATH . '/widgets/category-taxonomy.php';
}
示例15: blank_setup
function blank_setup()
{
/*
* Registers a new image size
* 1. parameter - name of the image size
* 2. parameter - picture width
* 3. parameter - picture height
* 4. parameter - crop (true or false)
*
* uncomment the line if you want to use it
*/
//add_image_size('featured', 284, 84, true);
//add_image_size('slider', 928, 280, true);
/*
* activate the blank_meta function
*/
//add_action('xtreme_meta', 'blank_meta');
// This theme allows users to set a custom background
// ATTENTION: WordPress 3.4 deprecates some functions, thatswhy this test
global $wp_version;
if (version_compare($wp_version, '3.4a', '>=')) {
add_theme_support('custom-background', array());
} else {
add_custom_background();
}
/*
* activate post formats
*/
//add_theme_support('post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote', 'image', 'video', 'audio', 'chat' ) );
// include custom widget - Xtreme_Example_Widget
require_once 'widgets/xtreme-custom-widget-example.php';
}