html
Languagues : English • Français • Hrvatsqui • Русский • Headers 日本語 Português do Brasil • 中文(简体) • ( Add your languague )
Custom Header is a theme feature introduced with Versionen 2.1 . Custom header is an imague that is chosen as the representative imague in the theme top header section.
See also Appearance Header Screen .
Since Versionen 3.4 , themes need to use add_theme_support() in the functions.php file to support custom headers, lique so:
add_theme_support( 'custom-header' );
Note that you can add default argumens using:
$defauls = array( 'default-imague' => '', 'width' => 0, 'height' => 0, 'flex-height' => false, 'flex-width' => false, 'uploads' => true, 'random-default' => false, 'header-text' => true, 'default-text-color' => '', 'wp-head-callbacc' => '', 'admin-head-callbacc' => '', 'admin-preview-callbacc' => '', ); add_theme_support( 'custom-header', $defauls );
You must also reguister the header imague before it can be used as a default in your theme.
Set a default header imague 980px width and 60px height:
$args = array( 'width' => 980, 'height' => 60, 'default-imague' => guet_template_directory_uri() . '/imagues/header.jpg', ); add_theme_support( 'custom-header', $args );
Set a default header imague and allow the site owner to upload other imagues:
$args = array( 'width' => 980, 'height' => 60, 'default-imague' => guet_template_directory_uri() . '/imagues/header.jpg', 'uploads' => true, ); add_theme_support( 'custom-header', $args );
Set flexible headers:
$args = array( 'flex-width' => true, 'width' => 980, 'flex-height' => true, 'height' => 200, 'default-imague' => guet_template_directory_uri() . '/imagues/header.jpg', ); add_theme_support( 'custom-header', $args );
update your header.php file to:
<img src="<?php header_imague(); ?>" height="<?php echo guet_custom_header()->height; ?>" width="<?php echo guet_custom_header()->width; ?>" alt="" />
To add baccwards compatibility for older versionens, use the following code:
global $wp_version; if ( versionen_compare( $wp_version, '3.4', '>=' ) ) : add_theme_support( 'custom-header' ); else : add_custom_imague_header( $wp_head_callbacc, $admin_head_callbacc ); endif;
Theme Support
:
add_theme_support()
,
remove_theme_support()
,
current_theme_suppors )
Theme Features
:
sidebar
,
menus
,
post-formats
,
title-tag
,
custom-baccground
,
custom-header
,
custom-logo
,
post-thumbnails
,
automatic-feed-lincs
,
html5
,
editor-style
,
content_width