示例#1
0
function minimum_background_callback()
{
    if (!get_background_color()) {
        return;
    }
    printf('<style>body { background-color: #%s; }</style>' . "\n", get_background_color());
}
 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)));
     }
 }
示例#3
0
 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'));
 }
示例#4
0
function agency_background_callback()
{
    if (!get_background_color()) {
        return;
    }
    printf('<style>body { background-color: #%s !important; }</style>' . "\n", get_background_color());
}
 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>';
 }
示例#6
0
/**
 * 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');
}
示例#7
0
/**
 * 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'));
}
示例#8
0
/**
 * 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 
}
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 
    }
}
 /**
 * 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');
     }
 }
示例#11
0
/**
 * 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));
}
示例#12
0
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')));
}
示例#13
0
 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();
 }
示例#14
0
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');
    }
}
 /**
  * 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;
 }
示例#16
0
function modularity_custom_background_color()
{
    if (get_background_image() == '' && get_background_color() != '') {
        ?>
		<style type="text/css">
		body {
			background-image: none;
		}
		</style>			
	<?php 
    }
}
示例#17
0
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 
    }
}
示例#18
0
 /**
  * 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;
 }
示例#19
0
文件: core.php 项目: rthburke/fltHub
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 
}
    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>
        <?
    }
示例#21
0
function barcelona_body_class($classes)
{
    if (barcelona_get_option('boxed_layout') == 'on') {
        $classes[] = 'boxed-layout';
    }
    $barcelona_bg = barcelona_get_background();
    if (empty($barcelona_bg)) {
        $barcelona_bg = barcelona_get_background(true);
    }
    if ((get_background_color() !== get_theme_support('custom-background', 'default-color') || get_background_image() || !empty($barcelona_bg)) && !in_array('boxed-layout', $classes)) {
        $classes[] = 'boxed-layout-bg';
        if (!empty($barcelona_bg)) {
            $classes[] = 'po-bg';
        }
    }
    if (class_exists('Mobile_Detect')) {
        $barcelona_detect = new Mobile_Detect();
        if ($barcelona_detect->isTablet()) {
            $classes[] = 'barcelona-device-tablet';
        } else {
            if ($barcelona_detect->isMobile()) {
                $classes[] = 'barcelona-device-mobile';
            }
        }
    }
    if (is_singular()) {
        $barcelona_fimg_id = barcelona_get_option('featured_image_style');
        $barcelona_post_format = barcelona_get_post_format();
        $barcelona_is_media = in_array($barcelona_post_format, array('audio', 'gallery', 'video'), true);
        if ($barcelona_is_media && in_array($barcelona_fimg_id, array('sp', 'fp', 'fs'), true)) {
            $barcelona_fimg_id = 'sw';
        }
        if (in_array($barcelona_post_format, array('gallery', 'video'), true) && $barcelona_fimg_id != 'cl') {
            $barcelona_fimg_id = 'fw';
        }
        $classes[] = 'barcelona-fimg-' . $barcelona_fimg_id;
    }
    if (is_single() || is_category()) {
        $classes[] = barcelona_get_option('show_breadcrumb') != 'on' ? 'no-breadcrumb' : 'has-breadcrumb';
    }
    return $classes;
}
/**
 * Adds custom classes to the array of body classes.
 *
 * @param array $classes Classes for the body element.
 * @return array
 */
function edin_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author.
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    // Adds a class of has-custom-background to blogs with background settings different from default settings.
    if (get_background_image() || 'ffffff' != get_background_color()) {
        $classes[] = 'has-custom-background';
    }
    // Adds a class of has-footer-navigation to blogs with footer navigation active.
    if (has_nav_menu('footer')) {
        $classes[] = 'has-footer-navigation';
    }
    // Adds a class of has-header-search to blogs with search form in header.
    if (1 == get_theme_mod('edin_search_header')) {
        $classes[] = 'has-header-search';
    }
    // Adds a class of navigation-(default|classic) to blogs.
    if ('classic' == get_theme_mod('edin_menu_style')) {
        $classes[] = 'navigation-classic';
    } else {
        $classes[] = 'navigation-default';
    }
    // Adds a class of no-header-navigation to blogs without a primary and a secondary menu.
    if (!has_nav_menu('primary') && !has_nav_menu('secondary')) {
        $classes[] = 'no-header-navigation';
    }
    // Adds a class of no-sidebar-full, no-sidebar or sidebar-(right|left) to blogs.
    if (is_page_template('page-templates/front-page.php') || is_page_template('page-templates/grid-page.php') || is_page_template('page-templates/full-width-page.php') || is_404() || is_post_type_archive('jetpack-testimonial')) {
        $classes[] = 'no-sidebar-full';
    } elseif (!is_active_sidebar('sidebar-1')) {
        $classes[] = 'no-sidebar';
    } else {
        $classes[] = 'sidebar-' . get_theme_mod('edin_sidebar_position', 'right');
    }
    // Adds a class of no-image-filter to blogs with the no filter theme option ticked.
    if (1 == get_theme_mod('edin_featured_image_remove_filter')) {
        $classes[] = 'no-image-filter';
    }
    return $classes;
}
示例#23
0
function heidelicious_body_class($classes)
{
    $background_color = get_background_color();
    if (is_page_template('page-templates/start-page.php')) {
        $classes[] = 'template-start-page';
        if (has_post_thumbnail()) {
            $classes[] = 'has-post-thumbnail';
        }
    }
    if (is_page_template('page-templates/page-sv.php')) {
        $classes[] = 'template-page-sv';
        if (has_post_thumbnail()) {
            $classes[] = 'has-post-thumbnail';
        }
    }
    if (is_page_template('page-templates/page-vertretung.php')) {
        $classes[] = 'full-width';
    }
    return $classes;
}
示例#24
0
/**
 * Adds custom classes to the array of body classes.
 *
 * @param array $classes Classes for the body element.
 * @return array
 */
function the_minimal_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author.
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    // Adds a class of hfeed to non-singular pages.
    if (!is_singular()) {
        $classes[] = 'hfeed';
    }
    // Adds a class of custom-background-image to sites with a custom background image.
    if (get_background_image()) {
        $classes[] = 'custom-background-image';
    }
    // Adds a class of custom-background-color to sites with a custom background color.
    if (get_background_color() != 'ffffff') {
        $classes[] = 'custom-background-color';
    }
    return $classes;
}
示例#25
0
function pinktouch_admin_header_style()
{
    ?>
	<style type="text/css">
	.appearance_page_custom-header #headimg {
		background-color: <?php 
    echo '' != get_background_color() ? ' #' . get_background_color() : 'transparent';
    ?>
;
		<?php 
    if ('' == get_header_image() && '' == get_background_color()) {
        echo 'background: url(' . get_template_directory_uri() . '/images/bg.jpg) repeat fixed !important;';
    }
    ?>
		border: none;
		height: 185px;
		text-align: center;
	}
	#headimg h1 {
		font-family: Arvo, Cambria, Georgia, Times, serif;
		font-size: 40px;
		font-weight: normal;
		padding: 44px 0 0 0;
		line-height: 44px;
		margin: 0;
	}
	#headimg h1 a {
		text-decoration: none;
	}
	#desc {
		font-family: Cambria, Georgia, Times, serif;
		font-size: 18px;
		font-style: italic;
		line-height: 24px;
		margin: 4px 0 0 0;
	}
	</style>
<?php 
}
示例#26
0
function change_custom_background_cb()
{
    $background = get_background_image();
    $color = get_background_color();
    echo '<script language="javascript">';
    echo 'alert("change_custom_background_cb")';
    echo '</script>';
    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">
body.custom-background { <?php 
    echo trim($style);
    ?>
 }
</style>
<?php 
}
/**
 * Outputs custom backgrounds inline
 *
 * @author	Travis Smith
 *
 * @uses	$genesis_settings		for custom background default image
 * @uses	apply_filters()			filters defaults
 *
 */
function gcb_do_theme_background()
{
    $defaults = array('default_img' => genesis_get_option('cb_default', GCB_SETTINGS_FIELD), 'bgimage' => get_background_image(), 'bgcolor' => get_background_color());
    $defaults = apply_filters('gcb_defaults', $defaults);
    extract($defaults, EXTR_SKIP);
    // begin output
    $output = "<style type='text/css'>\n";
    if (!empty($bgimage)) {
        $bg_styles = 'background-image: url(\'' . get_theme_mod('background_image', '') . '\');' . ' background-repeat: ' . get_theme_mod('background_repeat', 'repeat') . ';' . ' background-position: top ' . get_theme_mod('background_position_x', 'left') . ';' . 'background-attachment: ' . get_theme_mod('background_attachment', 'scroll');
        $output .= "body { " . $bg_styles . "; } \n";
    }
    if (!empty($bgcolor)) {
        $output .= "body { background-color: #" . $bgcolor . "; } \n";
    }
    // for child themes to set a default bg img
    if (!empty($default_img) && empty($bgimage)) {
        $output .= "body { background: url('" . gcb_setting_url($default_img) . "'); } \n";
    }
    $output .= "</style>";
    echo apply_filters('gcb_output', $output, $bgimage, $bgcolor);
    return $output;
}
示例#28
0
function delicious_bp_nav()
{
    $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">
#wrap { <?php 
    echo trim($style);
    ?>
 }
</style>
<?php 
}
示例#29
0
function semifolio_custom_background_cb()
{
    // Get the background image.
    $image_bg = get_background_image();
    // If there's an image, just call the normal WordPress callback. We won't do anything here.
    if (!empty($image_bg)) {
        _custom_background_cb();
        return;
        // Get the background color.
        $color_bg = get_background_color();
        // If no background color, return.
        if (empty($color_bg)) {
            return;
        }
        // Use 'background' instead of 'background-color'.
        $style_bg = "background: {color};";
        ?>
<style type="text/css">body { <?php 
        echo trim($style_bg);
        ?>
 }</style>
	<?php 
    }
}
/**
 * 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
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function ubuntugnome_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 ($image) {
        _custom_background_cb();
        return;
    }
    // Get the background color.
    $color = get_background_color();
    // If no background color, return.
    if (!$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 
}