• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_background_color函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: minimum_background_callback

function minimum_background_callback()
{
    if (!get_background_color()) {
        return;
    }
    printf('<style>body { background-color: #%s; }</style>' . "\n", get_background_color());
}
开发者ID:lisajwells,项目名称:lustre,代码行数:7,代码来源:functions.php


示例2: header_background

 public function header_background()
 {
     $header_background = listify_theme_mod('color-header-background');
     $navigation = listify_theme_mod('color-navigation-text');
     $this->css->add(array('selectors' => array('.search-overlay', '.primary-header'), 'declarations' => array('background-color' => $header_background)));
     $this->css->add(array('selectors' => array('.nav-menu a', '.nav-menu li:before', '.nav-menu li:after', '.nav-menu a:before', '.nav-menu a:after', '.nav-menu ul a', '.nav-menu.primary ul ul a', '.nav-menu.primary ul ul li:before', '.nav-menu.primary ul ul li:after'), 'declarations' => array('color' => $header_background)));
     $this->css->add(array('selectors' => array('.nav-menu.primary a', '.nav-menu.primary li:before', '.nav-menu.primary li:after', '.nav-menu.primary a:before', '.nav-menu.primary a:after'), 'declarations' => array('color' => $navigation), 'media' => 'screen and (min-width: 992px)'));
     $this->css->add(array('selectors' => array('.search-overlay a.search-overlay-toggle'), 'declarations' => array('color' => $navigation)));
     if ('Dark' == $this->scheme) {
         /* on the non-mobile menu set the top level link items to the set color */
         $this->css->add(array('selectors' => array('.site-header .nav-menu a', '.site-header .nav-menu li:before', '.site-header .nav-menu li:after', '.site-header .nav-menu a:before', '.site-header .nav-menu a:after', '.site-header .nav-menu ul ul.category-list a', '.nav-menu.tertiary a', '.nav-menu.tertiary li:before', '.nav-menu.tertiary li:after'), 'declarations' => array('color' => $navigation), 'media' => 'screen and (min-width: 992px)'));
         /* on the mobile menu dropdown set the links to the header color */
         $this->css->add(array('selectors' => array('.site-header .nav-menu ul ul a', '.site-header .nav-menu ul ul li:before', '.site-header .nav-menu ul ul li:after', '.nav-menu.tertiary ul a', '.nav-menu.tertiary ul li:before'), 'declarations' => array('color' => $header_background)));
         $this->css->add(array('selectors' => array('ul.nav-menu .sub-menu.category-list', '.tertiary-navigation'), 'declarations' => array('background-color' => $header_background)));
         $this->css->add(array('selectors' => array('.main-navigation', 'ul.nav-menu .sub-menu.category-list .category-count', '.call-to-action'), 'declarations' => array('background-color' => $this->css->darken($header_background, -15))));
         $this->css->add(array('selectors' => array('ul.nav-menu .sub-menu.category-list .container:before'), 'declarations' => array('border-top-color' => $this->css->darken($header_background, -15))));
     } elseif ('Light Gray' == $this->scheme) {
         $this->css->add(array('selectors' => array('.site-header .nav-menu a', '.site-header .nav-menu.secondary a', '.tertiary-navigation .nav-menu.tertiary a', '.tertiary-navigation .nav-menu.tertiary li:before', '.tertiary-navigation .nav-menu.tertiary li:after', '.tertiary-navigation .nav-menu.tertiary ul ul a', '.site-header .nav-menu li:before', '.site-header .nav-menu li:after', '.site-header .nav-menu a:before', '.site-header .nav-menu a:after', '.site-header .nav-menu ul ul a', '.site-header .nav-menu.primary ul ul a', '.site-header .nav-menu ul ul.category-list a', '.search-overlay a.search-overlay-toggle'), 'declarations' => array('color' => $navigation)));
         $this->css->add(array('selectors' => array('.main-navigation', '.category-list .category-count'), 'declarations' => array('background-color' => '#' . get_background_color())));
         $this->css->add(array('selectors' => array('ul.nav-menu .sub-menu.category-list .container:before'), 'declarations' => array('border-top-color' => '#' . get_background_color())));
     }
     if (in_array($this->scheme, array('Light Gray', 'Dark'))) {
         $this->css->add(array('selectors' => array('.nav-menu .sub-menu.category-list'), 'declarations' => array('background-color' => $header_background), 'media' => 'screen and (min-width: 768px)'));
         /* on the mobile menu set the toggle items to the navigation color */
         $this->css->add(array('selectors' => array('.navigation-bar-toggle', '.main-navigation .search-overlay-toggle', '.main-navigation .search-overlay .search-overlay-toggle'), 'declarations' => array('color' => $navigation)));
     }
 }
开发者ID:abdullahrahim,项目名称:shadighar,代码行数:27,代码来源:class-customizer-output-colors.php


示例3: ebor_load_scripts

 function ebor_load_scripts()
 {
     $protocol = is_ssl() ? 'https' : 'http';
     //Enqueue Styles
     wp_enqueue_style('ebor-merriweather-font', "{$protocol}://fonts.googleapis.com/css?family=Merriweather:300,400,700");
     wp_enqueue_style('ebor-lato-font', "{$protocol}://fonts.googleapis.com/css?family=Lato:300,400,400italic,600,600italic,700");
     wp_enqueue_style('ebor-open-sans-font', "{$protocol}://fonts.googleapis.com/css?family=Open+Sans:400");
     wp_enqueue_style('ebor-plugins', EBOR_THEME_DIRECTORY . 'style/css/plugins.css');
     wp_enqueue_style('ebor-style', get_stylesheet_uri());
     //Enqueue Scripts
     wp_enqueue_script('ebor-modernizr', EBOR_THEME_DIRECTORY . 'style/js/modernizr.js', array('jquery'), false, false);
     wp_enqueue_script('ebor-plugins', EBOR_THEME_DIRECTORY . 'style/js/plugins.js', array('jquery'), false, true);
     wp_enqueue_script('ebor-scripts', EBOR_THEME_DIRECTORY . 'style/js/scripts.js', array('jquery'), false, true);
     //Enqueue Comments
     if (is_singular() && comments_open() && get_option('thread_comments')) {
         wp_enqueue_script('comment-reply');
     }
     $highlight = get_option('huntington_color', '#3d9991');
     $background = '#' . get_background_color();
     $width = get_option('huntington_width', '260');
     $custom_styles = "\n\t\t\tp.small a {\n\t\t\t\tcolor: {$highlight};\n\t\t\t}\n\t\t\tp.small a:after {\n\t\t\t\tborder-bottom: 1px solid {$highlight};\n\t\t\t}\n\t\t\t#content,\n\t\t\t#background-color,\n\t\t\t#preloader {\n\t\t\t\tbackground: {$background};\n\t\t\t\tbackground-color: {$background};\n\t\t\t}\n\t\t\t#ajax-content p.small a {\n\t\t\t\tcolor: {$highlight};\n\t\t\t}\n\t\t\t@media only screen and (min-width : 1300px) {\n\t\t\t   header, #white-background {\n\t\t\t     width: " . (int) $width . "px;\n\t\t\t   }\n\t\t\t   \n\t\t\t   #content {\n\t\t\t       padding-left: " . (int) $width . "px;\n\t\t\t   }\n\t\t\t}\n\t\t";
     wp_add_inline_style('ebor-style', $custom_styles);
     //Add custom CSS ability
     wp_add_inline_style('ebor-style', get_option('custom_css'));
 }
开发者ID:anaguerra,项目名称:dombidau,代码行数:25,代码来源:theme_scripts.php


示例4: agency_background_callback

function agency_background_callback()
{
    if (!get_background_color()) {
        return;
    }
    printf('<style>body { background-color: #%s !important; }</style>' . "\n", get_background_color());
}
开发者ID:denis-chmel,项目名称:wordpress,代码行数:7,代码来源:functions.php


示例5: custom_background

 function custom_background()
 {
     $bg_image_url = get_background_image();
     $bg_color = get_background_color();
     // If the user has not defined a background
     // color or a background image, we stop.
     if (!$bg_image_url && !$bg_color) {
         return;
     }
     // If there is only a background color defined,
     // we apply it to <body>, then we stop.
     if (!$bg_image_url && $bg_color) {
         echo '<style>
             body {
                 background-color: #' . $bg_color . ';
             }
         </style>';
         return;
     }
     echo '<style>
         body {
             background-color: #' . $bg_color . ';
             background-image: url(' . $bg_image_url . ');
             background-repeat: ' . get_theme_mod('background_repeat', get_theme_support('custom-background', 'default-repeat')) . ';
             background-position: ' . get_theme_mod('background_position_x', get_theme_support('custom-background', 'default-position-x')) . ';
             background-attachment: ' . get_theme_mod('background_attachment', get_theme_support('custom-background', 'default-attachment')) . '
         }
     </style>';
 }
开发者ID:benjamincrozat,项目名称:wp-theme-boilerplate,代码行数:29,代码来源:helpers.php


示例6: toivo_lite_custom_background_callback

/**
 * This is a fix for when a user sets a custom background color with no custom background image. What 
 * happens is the theme's background image hides the user-selected background color.  If a user selects a 
 * background image, we'll just use the WordPress custom background callback.  This also fixes WordPress 
 * not correctly handling the theme's default background color.
 *
 * @link http://core.trac.wordpress.org/ticket/16919
 * @link http://core.trac.wordpress.org/ticket/21510
 * @author  Justin Tadlock, justintadlock.com
 * @link    http://themehybrid.com/themes/stargazer
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function toivo_lite_custom_background_callback()
{
    /* Get the background image. */
    $image = get_background_image();
    /* If there's an image, just call the normal WordPress callback. We won't do anything here. */
    if (!empty($image)) {
        _custom_background_cb();
        return;
    }
    /* Get the background color. */
    $color = get_background_color();
    /* If no background color, return. */
    if (empty($color)) {
        return;
    }
    /* Use 'background' instead of 'background-color'. */
    $style = "background: #{$color};";
    ?>
	<style type="text/css" id="custom-background-css">body.custom-background { <?php 
    echo trim($style);
    ?>
 }</style>
	<?php 
    /* Add custom-background body class if we get this far. */
    add_filter('body_class', 'toivo_lite_add_custom_background_class');
}
开发者ID:KateKupka,项目名称:darwin,代码行数:42,代码来源:custom-background.php


示例7: ebor_load_scripts

/**
 * Ebor Load Scripts
 * Properly Enqueues Scripts & Styles for the theme
 * @since version 1.0
 * @author TommusRhodus
 */
function ebor_load_scripts()
{
    $protocol = is_ssl() ? 'https' : 'http';
    //Enqueue Styles
    wp_enqueue_style('ebor-loom-raleway-font', "{$protocol}://fonts.googleapis.com/css?family=Raleway:400,300,500,600,700,800,900");
    wp_enqueue_style('ebor-bootstrap', get_template_directory_uri() . '/style/css/bootstrap.css');
    wp_enqueue_style('ebor-owl', get_template_directory_uri() . '/style/css/owl.carousel.css');
    wp_enqueue_style('ebor-fancybox', get_template_directory_uri() . '/style/js/fancybox/jquery.fancybox.css');
    wp_enqueue_style('ebor-fancybox-thumbs', get_template_directory_uri() . '/style/js/fancybox/helpers/jquery.fancybox-thumbs.css?v=1.0.2');
    if (class_exists('Woocommerce')) {
        wp_enqueue_style('ebor-woocommerce', get_template_directory_uri() . '/style/css/woocommerce.css');
    }
    wp_enqueue_style('ebor-style', get_stylesheet_uri());
    wp_enqueue_style('ebor-fonts', get_template_directory_uri() . '/style/type/fonts.css');
    wp_enqueue_style('ebor-custom', get_template_directory_uri() . '/custom.css');
    //Dequeue Styles
    wp_dequeue_style('aqpb-view-css');
    wp_deregister_style('aqpb-view-css');
    //Enqueue Scripts
    wp_enqueue_script('ebor-bootstrap', get_template_directory_uri() . '/style/js/bootstrap.min.js', array('jquery'), false, true);
    if (is_ssl()) {
        wp_enqueue_script('ebor-googlemapsapi', 'https://maps-api-ssl.google.com/maps/api/js?sensor=false&v=3.exp', array('jquery'), false, true);
    } else {
        wp_enqueue_script('ebor-googlemapsapi', 'http://maps.googleapis.com/maps/api/js?sensor=false&v=3.exp', array('jquery'), false, true);
    }
    wp_enqueue_script('ebor-plugins', get_template_directory_uri() . '/style/js/plugins.js', array('jquery'), false, true);
    wp_enqueue_script('ebor-scripts', get_template_directory_uri() . '/style/js/scripts.js', array('jquery'), false, true);
    //Enqueue Comments
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    /**
     * Dequeue Scripts
     */
    wp_dequeue_script('aqpb-view-js');
    wp_deregister_script('aqpb-view-js');
    /**
     * localize script
     */
    $script_data = array('fixed_header' => get_option('fixed_header', '1'), 'site_version' => get_option('site_version', 'multipage'));
    wp_localize_script('ebor-scripts', 'wp_data', $script_data);
    /**
     * Pass theme options to CSS
     */
    $highlight = get_option('highlight_colour', '#1abb9c');
    $highlightrgb = ebor_hex2rgb($highlight);
    $highlight_hover = get_option('highlight_hover_colour', '#17a78b');
    $dark_wrapper = get_option('wrapper_background_dark', '#f5f5f5');
    $header_bg = get_option('header_bg', '#f5f5f5');
    $header_dropdown_bg = get_option('header_dropdown_bg', '#414141');
    $footer_bg = get_option('footer_bg', '#303030');
    $sub_footer_bg = get_option('sub_footer_bg', '#2d2d2d');
    $header_bg_rgb = ebor_hex2rgb($header_bg);
    $custom_styles = "\n\t\t/**\n\t\t * Header\n\t\t */\n\t\t.navbar-header {\n\t\t\tbackground: {$header_bg};\n\t\t\tborder-top: 3px solid {$header_dropdown_bg};\n\t\t}\n\t\t\n\t\t.navbar.basic.fixed .navbar-header {\n\t\t\tbackground: rgba({$header_bg_rgb},0.94);\n\t\t}\n\t\t\n\t\t.navbar .dropdown-menu {\n\t\t\tbackground: {$header_dropdown_bg};\n\t\t}\n\t\t\n\t\t/**\n\t\t * Footer\n\t\t */\n\t\t.footer {\n\t\t\tbackground: {$footer_bg};\n\t\t}\n\t\t\n\t\t.sub-footer {\n\t\t\tbackground: {$sub_footer_bg};\n\t\t}\n\t\t\n\t\t/**\n\t\t * Page Wrappers Backgounds\n\t\t */\n\t\t.light-wrapper,\n\t\t#sub-header.sub-footer.social-light {\n\t\t    background: #" . get_background_color() . ";\n\t\t}\n\t\t.dark-wrapper,\n\t\t#sub-header.sub-footer.social-line {\n\t\t    background: {$dark_wrapper};\n\t\t}\n\t\t\n\t\t/**\n\t\t * Highlight Colours\n\t\t */\n\t\t.spinner,\n\t\t.tp-loader,\n\t\t#fancybox-loading div {\n\t\t    border-left: 3px solid rgba({$highlightrgb},.15) !important;\n\t\t    border-right: 3px solid rgba({$highlightrgb},.15) !important;\n\t\t    border-bottom: 3px solid rgba({$highlightrgb},.15) !important;\n\t\t    border-top: 3px solid rgba({$highlightrgb},.8) !important;\n\t\t}\n\t\ta,\n\t\t.colored,\n\t\t.post-title a:hover,\n\t\tul.circled li:before,\n\t\taside ul li:before,\n\t\t.lead.lite a:hover,\n\t\t.footer a:hover,\n\t\t.nav > li > a:hover,\n\t\t.nav > li.current > a,\n\t\t.navbar .nav .open > a,\n\t\t.navbar .nav .open > a:hover,\n\t\t.navbar .nav .open > a:focus,\n\t\t.navbar .dropdown-menu > li > a:hover,\n\t\t.navbar .dropdown-menu > li > a:focus,\n\t\t.navbar .dropdown-submenu:hover > a,\n\t\t.navbar .dropdown-submenu:focus > a,\n\t\t.navbar .dropdown-menu > .active > a,\n\t\t.navbar .dropdown-menu > .active > a:hover,\n\t\t.navbar .dropdown-menu > .active > a:focus,\n\t\t.filter li a:hover,\n\t\t.filter li a.active,\n\t\tul.circled li:before, \n\t\t.widget_categories ul li:before,\n\t\t.post-content ul li:before,\n\t\t.textwidget a,\n\t\t#sub-header .pull-left i,\n\t\t#sub-header.sub-footer.social-line .pull-left a:hover,\n\t\t#sub-header.sub-footer.social-light .pull-left a:hover,\n\t\t#menu-standard-navigation a.active  {\n\t\t    color: {$highlight};\n\t\t}\n\t\t.lead.lite a {\n\t\t    border-bottom: 1px solid {$highlight};\n\t\t}\n\t\t.btn,\n\t\t.parallax .btn-submit,\n\t\t.btn-submit,\n\t\t.newsletter-wrapper #mc_embed_signup .button,\n\t\t.widget_ns_mailchimp form input[type='submit'],\n\t\tinput[type='submit'],\n\t\t.bonfire-slideout-content input[type='submit'],\n\t\tinput[type='button'],\n\t\t.woocommerce .widget_price_filter .ui-slider-horizontal .ui-slider-range, .woocommerce-page .widget_price_filter .ui-slider-horizontal .ui-slider-range,\n\t\t.woocommerce span.onsale, .woocommerce-page span.onsale, .woocommerce ul.products li.product .onsale, .woocommerce-page ul.products li.product .onsale,\n\t\t.woocommerce .button,\n\t\t.added_to_cart,\n\t\t.ebor-count {\n\t\t    background: {$highlight};\n\t\t}\n\t\t.btn:hover,\n\t\t.btn:focus,\n\t\t.btn:active,\n\t\t.btn.active,\n\t\t.parallax .btn-submit:hover,\n\t\tinput[type='submit']:hover,\n\t\t.bonfire-slideout-content input[type='submit']:hover,\n\t\t.widget_ns_mailchimp form input[type='submit']:hover,\n\t\tinput[type='button']:hover,\n\t\t.woocommerce .button:hover,\n\t\t.added_to_cart:hover,\n\t\t.woocommerce .widget_price_filter .ui-slider .ui-slider-handle, .woocommerce-page .widget_price_filter .ui-slider .ui-slider-handle {\n\t\t    background: {$highlight_hover};\n\t\t}\n\t\t.tooltip-inner {\n\t\t    background-color: {$highlight};\n\t\t}\n\t\t.tooltip.top .tooltip-arrow,\n\t\t.tooltip.top-left .tooltip-arrow,\n\t\t.tooltip.top-right .tooltip-arrow {\n\t\t    border-top-color: {$highlight}\n\t\t}\n\t\t.tooltip.right .tooltip-arrow {\n\t\t    border-right-color: {$highlight}\n\t\t}\n\t\t.tooltip.left .tooltip-arrow {\n\t\t    border-left-color: {$highlight}\n\t\t}\n\t\t.tooltip.bottom .tooltip-arrow,\n\t\t.tooltip.bottom-left .tooltip-arrow,\n\t\t.tooltip.bottom-right .tooltip-arrow {\n\t\t    border-bottom-color: {$highlight}\n\t\t}\n\t\t.services-1 .col-wrapper:hover,\n\t\t.services-1 .col-wrapper:hover:before,\n\t\t.woocommerce .price {\n\t\t    border-color: {$highlight} !important;\n\t\t}\n\t\t.services-3 .icon i.icn {\n\t\t    color: {$highlight};\n\t\t    border: 2px solid {$highlight};\n\t\t}\n\t\t.services-3 .col:hover i.icn {\n\t\t    background-color: {$highlight};\n\t\t}\n\t\t.panel-title > a:hover {\n\t\t    color: {$highlight}\n\t\t}\n\t\t.progress-list li em {\n\t\t    color: {$highlight};\n\t\t}\n\t\t.progress.plain,\n\t\t.woocommerce .widget_price_filter .price_slider_wrapper .ui-widget-content, .woocommerce-page .widget_price_filter .price_slider_wrapper .ui-widget-content {\n\t\t    border: 1px solid {$highlight};\n\t\t}\n\t\t.progress.plain .bar {\n\t\t    background: {$highlight};\n\t\t}\n\t\t.meta.tags a:hover {\n\t\t    color: {$highlight}\n\t\t}\n\t\t.owl-carousel .owl-controls .owl-prev:hover,\n\t\t.owl-carousel .owl-controls .owl-next:hover {\n\t\t    border: 1px solid {$highlight};\n\t\t    color: {$highlight};\n\t\t}\n\t\t.navigation a:hover {\n\t\t    border: 1px solid {$highlight};\n\t\t    color: {$highlight};\n\t\t}\n\t\t.tp-caption a,\n\t\t#testimonials .author,\n\t\t.tabs-top .tab a:hover,\n\t\t.tabs-top .tab.active a {\n\t\t    color: {$highlight}\n\t\t}\n\t\t.parallax a:hover {\n\t\t    color: {$highlight_hover}\n\t\t}\n\t\t.pagination ul > li > a:hover,\n\t\t.pagination ul > li > a:focus,\n\t\t.pagination ul > .active > a,\n\t\t.pagination ul > .active > span {\n\t\t    border: 1px solid {$highlight};\n\t\t    color: {$highlight};\n\t\t}\n\t\t.sidebox a:hover {\n\t\t    color: {$highlight}\n\t\t}\n\t\t#comments .info h2 a:hover {\n\t\t    color: {$highlight}\n\t\t}\n\t\t#comments a.reply-link:hover {\n\t\t    color: {$highlight}\n\t\t}\n\t\t.pricing .plan h4 span {\n\t\t    color: {$highlight}\n\t\t}\n\t\t.bonfire-slideout-button:hover {\n\t\t\tcolor: {$highlight};\n\t\t}\n\t\t.bonfire-slideout-close:hover,\n\t\t.woocommerce .button:hover,\n\t\t.added_to_cart:hover,\n\t\t.woocommerce .price,\n\t\t.woocommerce-tabs ul.tabs li a:hover,\n\t\t.woocommerce-tabs ul.tabs li.active a {\n\t\t\tcolor: {$highlight} !important;\n\t\t}\n\t\t.bonfire-slideout-content .btn-submit {\n\t\t    background: {$highlight}\n\t\t}\n\t\t@media (max-width: 991px) { \n\t\t\t.navbar-nav > li > a,\n\t\t\t.navbar-nav > li > a:focus {\n\t\t\t    color: {$highlight}\n\t\t\t}\n\t\t}\n\t";
    if (get_background_image()) {
        $custom_styles .= "\n\t\t\t.light-wrapper {\n\t\t\t    background: none;\n\t\t\t}\n\t\t";
    }
    wp_add_inline_style('ebor-style', $custom_styles);
    wp_add_inline_style('ebor-style', get_option('custom_css'));
}
开发者ID:misfist,项目名称:loom-theme,代码行数:66,代码来源:styles_scripts.php


示例8: contango_custom_background_callback

/**
 * This is a fix for when a user sets a custom background color with no custom background image.  What
 * happens is the theme's background image hides the user-selected background color.  If a user selects a
 * background image, we'll just use the WordPress custom background callback.
 *
 * @link http://core.trac.wordpress.org/ticket/16919
 */
function contango_custom_background_callback()
{
    /* Get the background image. */
    $image = get_background_image();
    /* If there's an image, just call the normal WordPress callback. We won't do anything here. */
    if (!empty($image)) {
        _custom_background_cb();
        return;
    }
    /* Get the background color. */
    $color = get_background_color();
    /* If no background color, return. */
    if (empty($color)) {
        return;
    }
    /* Use 'background' instead of 'background-color'. */
    $style = "background: #{$color};";
    ?>
<style type="text/css">body.custom-background { <?php 
    echo trim($style);
    ?>
 }</style>

<?php 
}
开发者ID:whiterabbitny,项目名称:MyBDSMDream,代码行数:32,代码来源:functions.php


示例9: dusktodawn_custom_background

function dusktodawn_custom_background()
{
    if ('' != get_background_image()) {
        ?>
		<style type="text/css">
			#super-super-wrapper,
			#super-wrapper,
			#page,
			.right-sidebar #page {
				background: none;
				filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
			}
		</style>
	<?php 
    } elseif ('' != get_background_color()) {
        ?>
		<style type="text/css">
			#super-super-wrapper {
				background: none;
				filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
			}
		</style>
	<?php 
    }
}
开发者ID:darrylivan,项目名称:caraccidentlawyerflagstaff.com,代码行数:25,代码来源:functions.php


示例10: pilcrow_background_markup

 /**
 * Adds a containing div around everything if the custom background feature is in use
 *
 * @since Pilcrow 1.0
 */
 function pilcrow_background_markup()
 {
     // check if we're using a custom background image or color
     if ('' != get_background_color() || '' != get_background_image()) {
         add_action('pilcrow_before', 'pilcrow_wrap_before');
         add_action('pilcrow_after', 'pilcrow_wrap_after');
     }
 }
开发者ID:darrylivan,项目名称:caraccidentlawyerflagstaff.com,代码行数:13,代码来源:functions.php


示例11: aventurine_background_style

/**
 * Add background color to infinite scroll element
 */
function aventurine_background_style()
{
    $color = get_background_color();
    if (!$color) {
        return;
    }
    printf('<style type="text/css">#infinite-footer .container { background-color: #%s; }</style>', esc_attr($color));
}
开发者ID:Pellmellism,项目名称:aventurine,代码行数:11,代码来源:jetpack.php


示例12: engage_background_callback

function engage_background_callback()
{
    $background = get_background_image();
    $color = get_background_color();
    if (!$background && !$color) {
        return;
    }
    echo trim(sprintf("<style type='text/css'>.custom-background .site-header-banner { background: %s %s %s %s %s; } </style>", $background ? 'url(' . $background . ')' : '', $color ? '#' . $color : 'transparent', get_theme_mod('background_repeat', 'repeat'), get_theme_mod('background_position_x', 'left'), get_theme_mod('background_attachment', 'scroll')));
}
开发者ID:jpletner,项目名称:Avritek.Company.Site,代码行数:9,代码来源:functions.php


示例13: update_color_control

 public function update_color_control()
 {
     //for update global options
     global $wedding_style_color_control_page;
     foreach ($wedding_style_color_control_page->options_colorcontrol as $value) {
         ${$value}['var_name'] = $value['std'];
     }
     $background_color = get_background_color();
     $background_image = get_background_image();
 }
开发者ID:javalidigital,项目名称:multipla,代码行数:10,代码来源:color_control.php


示例14: restimpo_background_color

function restimpo_background_color()
{
    $background_color = get_background_color();
    if ($background_color != '') {
        ?>
		<?php 
        _e('#wrapper .entry-headline .entry-headline-text { background-color: #', 'restimpo');
        echo $background_color;
        _e(';}', 'restimpo');
    }
}
开发者ID:LSYanJun,项目名称:wordpress,代码行数:11,代码来源:headerdata.php


示例15: tinyframework_body_class

 /**
  * Extend the default WordPress `<body>` CSS classes to denote:
  *
  * @since Tiny Framework 1.0
  *
  * param array $classes Existing class values.
  *
  * @return array Filtered class values.
  */
 function tinyframework_body_class($classes)
 {
     $background_color = get_background_color();
     $background_image = get_background_image();
     // Using a full-width layout, when no active widgets in the sidebar or full-width template.
     if (!is_active_sidebar('sidebar-1') || is_page_template('page-templates/full-width.php') || is_attachment()) {
         $classes[] = 'full-width';
     }
     // Front Page template: thumbnail in use and number of sidebars for widget areas.
     if (is_page_template('page-templates/front-page.php')) {
         $classes[] = 'template-front-page';
         if (has_post_thumbnail()) {
             $classes[] = 'has-post-thumbnail';
         }
         if (is_active_sidebar('sidebar-2') && is_active_sidebar('sidebar-3')) {
             $classes[] = 'two-sidebars';
         }
     }
     // White or empty background color to change the layout and spacing.
     if (empty($background_image)) {
         if (empty($background_color)) {
             $classes[] = 'custom-background-empty';
         } elseif (in_array($background_color, array('fff', 'ffffff'))) {
             $classes[] = 'custom-background-white';
         }
     }
     // Enable custom font class only if the font CSS is queued to load.
     if (wp_style_is('tinyframework-fonts', 'queue')) {
         $classes[] = 'custom-font-enabled';
     }
     // Single or multiple authors.
     if (!is_multi_author()) {
         $classes[] = 'single-author';
     }
     // Index, archive views.
     if (is_archive() || is_search() || is_home()) {
         $classes[] = 'list-view';
     }
     // Single views. is_singular applies when one of the following returns true: is_single(), is_page() or is_attachment()
     if (is_singular() && !is_front_page()) {
         $classes[] = 'singular';
     }
     // Presence of header image.
     if (get_header_image()) {
         $classes[] = 'header-image-yes';
     } else {
         $classes[] = 'header-image-no';
     }
     // Presence of footer widget(s).
     if (is_active_sidebar('sidebar-4') || is_active_sidebar('sidebar-5') || is_active_sidebar('sidebar-6')) {
         $classes[] = 'footer-widgets';
     }
     return $classes;
 }
开发者ID:guillermohernandez,项目名称:OYFF-Wordpress-Theme,代码行数:63,代码来源:template-tags.php


示例16: modularity_custom_background_color

function modularity_custom_background_color()
{
    if (get_background_image() == '' && get_background_color() != '') {
        ?>
		<style type="text/css">
		body {
			background-image: none;
		}
		</style>			
	<?php 
    }
}
开发者ID:besimhu,项目名称:legacy,代码行数:12,代码来源:functions.php


示例17: meso_add_container_style

function meso_add_container_style()
{
    $bg_image = get_background_image();
    $bg_color = get_background_color();
    $header_image = get_header_image();
    if ($bg_image || $bg_color) {
        ?>
.container-wrap, footer .ftop {float: left;margin: 0;padding: 2% 2% 0 2%;width: 96%;background-color:white;}
#header {background:white;}footer.footer-bottom {background:transparent none !important;}.fbottom {background-color: #52C0D4;color:#fff !important;width: 96%;margin: 0;padding: 0.6em 2% !important;}#siteinfo {margin:0 0 0 1.6em;}@media only screen and (min-width:300px) and (max-width:770px){.container-wrap, #custom footer .ftop {float: left;margin: 0;padding: 2% !important;width: 96% !important;background-color:white;}#custom-img-header {margin:0 0 2em;}}
<?php 
    }
}
开发者ID:jun200,项目名称:wordpress,代码行数:12,代码来源:options-functions.php


示例18: body_class

 /**
  * Extend the default WordPress body classes.
  *
  * @since Agama 1.0.0
  * @param array $classes Existing class values.
  * @return array Filtered class values.
  */
 function body_class($classes)
 {
     $background_color = get_background_color();
     $background_image = get_background_image();
     $header = get_theme_mod('agama_header_style', 'default');
     $sidebar_position = get_theme_mod('agama_sidebar_position', 'right');
     $blog_layout = get_theme_mod('agama_blog_layout', 'list');
     // If header "sticky"
     if ($header == 'sticky') {
         $classes[] = 'sticky_header';
     }
     // If sidebar position "left"
     if ($sidebar_position == 'left') {
         $classes[] = 'sidebar_left';
     }
     // If blog layout "small_thumbs"
     if ($blog_layout == 'small_thumbs') {
         $classes[] = 'blog_small_thumbs';
     }
     // If blog layout "grid"
     if ($blog_layout == 'grid') {
         $classes[] = 'blog_grid';
     }
     // If page template "full-width"
     if (is_page_template('page-templates/full-width.php')) {
         $classes[] = 'full-width';
     }
     // If page template "front-page"
     if (is_page_template('page-templates/front-page.php')) {
         $classes[] = 'template-front-page';
         if (has_post_thumbnail()) {
             $classes[] = 'has-post-thumbnail';
         }
     }
     // If empty background
     if (empty($background_image)) {
         if (empty($background_color)) {
             $classes[] = 'custom-background-empty';
         } elseif (in_array($background_color, array('fff', 'ffffff'))) {
             $classes[] = 'custom-background-white';
         }
     }
     // Enable custom font class only if the font CSS is queued to load.
     if (wp_style_is('PTSans', 'queue')) {
         $classes[] = 'custom-font-enabled';
     }
     // Single Author
     if (!is_multi_author()) {
         $classes[] = 'single-author';
     }
     return $classes;
 }
开发者ID:beatrixmichella,项目名称:fufyflorist,代码行数:59,代码来源:agama-class.php


示例19: extra_custom_background_cb

function extra_custom_background_cb()
{
    // $background is the saved custom image, or the default image.
    $background = set_url_scheme(get_background_image());
    // $color is the saved custom color.
    // A default has to be specified in style.css. It will not be printed here.
    $color = get_background_color();
    if ($color === get_theme_support('custom-background', 'default-color')) {
        $color = false;
    }
    if (!$background && !$color) {
        return;
    }
    $style = $color ? "background-color: #{$color};" : '';
    if ($background) {
        $image = " background-image: url('{$background}');";
        $_repeat = get_theme_mod('background_repeat', get_theme_support('custom-background', 'default-repeat'));
        if (!in_array($_repeat, array('no-repeat', 'repeat-x', 'repeat-y', 'repeat'))) {
            $_repeat = 'repeat';
        }
        $repeat = " background-repeat: {$_repeat};";
        if ('no-repeat' == $_repeat) {
            $repeat .= " background-size: cover;";
        }
        $position = get_theme_mod('background_position_x', get_theme_support('custom-background', 'default-position-x'));
        if (!in_array($position, array('center', 'right', 'left'))) {
            $position = 'left';
        }
        $position = " background-position: top {$position};";
        $attachment = get_theme_mod('background_attachment', get_theme_support('custom-background', 'default-attachment'));
        if (!in_array($attachment, array('fixed', 'scroll'))) {
            $attachment = 'scroll';
        }
        $attachment = " background-attachment: {$attachment};";
        $style .= $image . $repeat . $position . $attachment;
    }
    ?>
<style type="text/css" id="extra-custom-background-css">
body.custom-background { <?php 
    echo trim($style);
    ?>
 }
</style>
<?php 
}
开发者ID:rthburke,项目名称:fltHub,代码行数:45,代码来源:core.php


示例20: change_custom_background_cb

    function change_custom_background_cb() {
        $background = get_background_image();
        $color = get_background_color();
        if ( ! $background && ! $color )
            return;
        $style = $color ? "background-color: #$color;" : '';
        if ( $background ) {
            $image = " background-image: url('$background');";

            $repeat = get_theme_mod( 'background_repeat', 'repeat' );

            if ( ! in_array( $repeat, array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat' ) ) )
                $repeat = 'repeat';

            $repeat = " background-repeat: $repeat;";

            $position = get_theme_mod( 'background_position_x', 'left' );

            if ( ! in_array( $position, array( 'center', 'right', 'left' ) ) )
                $position = 'left';

            $position = " background-position: top $position;";

            $attachment = get_theme_mod( 'background_attachment', 'scroll' );

            if ( ! in_array( $attachment, array( 'fixed', 'scroll' ) ) )
                $attachment = 'scroll';

            $attachment = " background-attachment: $attachment;";

            $style .= $image . $repeat . $position . $attachment;
        }
        ?>
        <style type="text/css" id="custom-background-css">
            .custom-background { 
                <?php 
echo trim($style);
?>
            }
        </style>
        <?
    }
开发者ID:TCCinTaiwan,项目名称:KUAS_CSIE_Wordpress_Themes_TCC-Department,代码行数:42,代码来源:theme_customiser.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_background_image函数代码示例发布时间:2022-05-15
下一篇:
PHP get_awpcp_option函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap