/
var
/
www
/
barefootlaw.org
/
wp-content
/
themes
/
barefoot
/
inc
/
basement
/
Upload File
HOME
<?php /** * Implement Custom Header functionality for Covercase * * @package Aisconverse * @subpackage Covercase * @since Covercase 1.0 */ if ( ! function_exists( 'covercase_custom_header_setup' ) ) { /** * Set up the WordPress core custom header settings. * * @since Covercase 1.0 */ function covercase_custom_header_setup() { /** * Filter Covercase custom-header support arguments. * * @since Covercase 1.0 */ add_theme_support( 'custom-header', apply_filters( 'covercase_custom_header_args', array( 'header-text' => false, 'wp-head-callback' => 'covercase_header_style' ) ) ); // Setup the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'covercase_custom_background_args', array( 'default-color' => 'ffffff', 'default-attachment' => 'fixed', ) ) ); } add_action( 'after_setup_theme', 'covercase_custom_header_setup' ); } if ( ! function_exists( 'covercase_header_style' ) ) { /** * Styles for header * * @since Covercase 1.0 */ function covercase_header_style() { $header_image = get_header_image(); ?> <style type="text/css" id="theme-header-css"> <?php if ( ! empty( $header_image ) ) { ?> header.header { /* * No shorthand so the Customizer can override individual properties. * @see https://core.trac.wordpress.org/ticket/31460 */ background-image: url(<?php header_image(); ?>); background-repeat: no-repeat; background-position: 50% 50%; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } <?php } ?> </style> <?php } } // covercase_header_style if ( ! function_exists( 'covercase_header_background_color_css' ) ) { /** * Enqueues front-end CSS for the header background color. * * @since Covercase 1.0 */ function covercase_header_background_color_css() { $default_color = 'ffffff'; $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 { background-color: %1$s; } '; wp_add_inline_style( 'theme-inline-style', sprintf( $css, $header_background_color ) ); } add_action( 'wp_enqueue_scripts', 'covercase_header_background_color_css', 11 ); }