*
* @package Trvl
*/
/**
* Setup the WordPress core custom header feature.
*
* Use add_theme_support to register support for WordPress 3.4+
* as well as provide backward compatibility for previous versions.
* Use feature detection of wp_get_theme() which was introduced
* in WordPress 3.4.
*
* @todo Rework this function to remove WordPress 3.4 support when WordPress 3.6 is released.
*
* @uses trvl_header_style()
* @uses trvl_admin_header_style()
* @uses trvl_admin_header_image()
*
* @package Trvl
*/
function trvl_custom_header_setup() {
$args = apply_filters( 'trvl_custom_header_args', array(
'default-image' => '',
'default-text-color' => '4ba6b5',
'width' => 950,
'height' => 250,
'flex-height' => true,
'wp-head-callback' => 'trvl_header_style',
'admin-head-callback' => 'trvl_admin_header_style',
'admin-preview-callback' => 'trvl_admin_header_image',
) );
add_theme_support( 'custom-header', $args );
}
add_action( 'after_setup_theme', 'trvl_custom_header_setup' );
if ( ! function_exists( 'trvl_header_style' ) ) :
/**
* Styles the header image and text displayed on the blog
*
* @see trvl_custom_header_setup().
*/
function trvl_header_style() {
$header_text_color = get_header_textcolor();
// 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 == $header_text_color )
return;
// If we get this far, we have custom styles. Let's do this.
?>
Header admin panel.
*
* @see trvl_custom_header_setup().
*/
function trvl_admin_header_style() {
?>
Header admin panel.
*
* @see trvl_custom_header_setup().
*/
function trvl_admin_header_image() {
$style = sprintf( ' style="color:#%s;"', get_header_textcolor() );
$header_image = get_header_image();
?>