*
* @package Timepiece
* @since Timepiece 1.0
*/
/**
* Setup the WordPress core custom header feature.
*
* @uses timepiece_header_style()
* @uses timepiece_admin_header_style()
* @uses timepiece_admin_header_image()
*
* @package Timepiece
*/
function timepiece_custom_header_setup() {
add_theme_support( 'custom-header', apply_filters( 'timepiece_custom_header_args', array(
'default-text-color' => '1a1a1a',
'width' => 1040,
'height' => 290,
'flex-height' => true,
'wp-head-callback' => 'timepiece_header_style',
'admin-head-callback' => 'timepiece_admin_header_style',
'admin-preview-callback' => 'timepiece_admin_header_image',
) ) );
}
add_action( 'after_setup_theme', 'timepiece_custom_header_setup' );
if ( ! function_exists( 'timepiece_header_style' ) ) :
/**
* Styles the header image and text displayed on the blog
*
* @see timepiece_custom_header_setup().
*
* @since Timepiece 1.0
*/
function timepiece_header_style() {
// If no custom options for text are set, let's bail
// get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value
if ( HEADER_TEXTCOLOR == get_header_textcolor() )
return;
// If we get this far, we have custom styles. Let's do this.
?>
Header admin panel.
*
* @see timepiece_custom_header_setup().
*
* @since Timepiece 1.0
*/
function timepiece_admin_header_style() {
?>
Header admin panel.
*
* @see timepiece_custom_header_setup().
*
* @since Timepiece 1.0
*/
function timepiece_admin_header_image() {
$style = sprintf( ' style="color:#%s;"', get_header_textcolor() );
$header_image = get_header_image();
?>