• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / twentyfifteen_header_background_color_css() – Enqueues front-end CSS for the header background color.

You appear to be a bot. Output may be restricted

Description

Enqueues front-end CSS for the header background color.

Usage

twentyfifteen_header_background_color_css();

Parameters

Returns

void

Source

File name: twentyfifteen/inc/custom-header.php
Lines:

1 to 37 of 37
function twentyfifteen_header_background_color_css() {
  $color_scheme            = twentyfifteen_get_color_scheme();
  $default_color           = $color_scheme[1];
  $header_background_color = get_theme_mod( 'header_background_color', $default_color );

  // Don't do anything if the current color is the default.
  if ( $header_background_color === $default_color ) {
    return;
  }

  $css = '
		/* Custom Header Background Color */
		body:before,
		.site-header {
			background-color: %1$s;
		}

		@media screen and (min-width: 59.6875em) {
			.site-header,
			.secondary {
				background-color: transparent;
			}

			.widget button,
			.widget input[type="button"],
			.widget input[type="reset"],
			.widget input[type="submit"],
			.widget_calendar tbody a,
			.widget_calendar tbody a:hover,
			.widget_calendar tbody a:focus {
				color: %1$s;
			}
		}
	';

  wp_add_inline_style( 'twentyfifteen-style', sprintf( $css, $header_background_color ) );
}
 

 View on Trac

Published: 19th December 2019 | Last updated: 19th December 2019

Primary Sidebar

Information

Function name: twentyfifteen_header_background_color_css
Plugin ref: Twenty Fifteen
Version: 3.3
Sourcefile: inc/custom-header.php
File ref: inc/custom-header.php
Deprecated?: No
API Letters: B,C,H,T

Footer

WordPress a2z
WordPress a2z
WordPress Dynamic API Reference
WordPress 6.1.1. PHP: 8.0.28
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wp-a2z.org
© Copyright WordPress a2z 2014-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites