I'm using Twenty Thirteen Child theme for my website running WP 4.5.3. I would like to change the header banner dimension to 900x480.
The content of my twentythirteen-child/functions.php
:
<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
// remove default action from Twenty Twelve
/*remove_action( 'after_setup_theme', 'twentythirteen_custom_header_setup' );*/
function twentythirteenchild_custom_header_setup() {
$args = array(
// Text color and image (empty to use none).
'default-text-color' => '220e10',
'default-image' => '%s/images/headers/circle.png',
// Set height and width, with a maximum value for the width.
'height' => 480,
'width' => 900,
// Callbacks for styling the header and the admin preview.
'wp-head-callback' => 'twentythirteen_header_style',
'admin-head-callback' => 'twentythirteen_admin_header_style',
'admin-preview-callback' => 'twentythirteen_admin_header_image',
);
add_theme_support( 'custom-header', $args );
}
add_action( 'after_setup_theme', 'twentythirteenchild_custom_header_setup', 11 );
remove_filter( 'HEADER_IMAGE_WIDTH', 'twentyeleven_header_image_width' );
remove_filter( 'HEADER_IMAGE_HEIGHT', 'twentyeleven_header_image_height' );
define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentythirteen_header_image_width', 900 ) );
define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentythirteen_header_image_height', 480 ) );
It works, but only partially.
When adding a 900x480 image, I obtained:
which is good. When either pressing on Crop Image or Skip Cropping, I obtained:
which is not good at all.
Could you please help?
Thank you very much in advance!!