*
* @package Moesia
*/
/**
* Setup the WordPress core custom header feature.
*
* @uses moesia_header_style()
* @uses moesia_admin_header_style()
* @uses moesia_admin_header_image()
*/
function moesia_custom_header_setup() {
add_theme_support( 'custom-header', apply_filters( 'moesia_custom_header_args', array(
'default-image' => get_template_directory_uri() . '/images/header.jpg',
'width' => 1920,
'height' => 1080,
'flex-height' => true,
'wp-head-callback' => 'moesia_header_style',
'admin-head-callback' => 'moesia_admin_header_style',
'admin-preview-callback' => 'moesia_admin_header_image',
) ) );
}
add_action( 'after_setup_theme', 'moesia_custom_header_setup' );
if ( ! function_exists( 'moesia_header_style' ) ) :
/**
* Styles the header image
*
* @see moesia_custom_header_setup().
*/
function moesia_header_style() {
$himage = get_post_meta( get_the_ID(), 'wpcf-header-image', true );
if ( get_header_image() || $himage !='' ) {
?>
Header admin panel.
*
* @see moesia_custom_header_setup().
*/
function moesia_admin_header_style() {
?>
Header admin panel.
*
* @see moesia_custom_header_setup().
*/
function moesia_admin_header_image() {
$style = sprintf( ' style="color:#%s;"', get_header_textcolor() );
?>