Custom Header is a Theme feature though which WordPress Header Image can be changed easily from the ‘Appearance > Header’ section. Most of the time the ‘header image is used as ‘website logo’ therefore it becomes important that theme developers should enable this feature in their theme.
To enable Custom Header add the below code in your theme’s functions.php file –
/*Custom header*/ $args = array( 'width' => 300, 'height' => 150, 'default-image' => get_template_directory_uri() . '/Images/logo.png', ); add_theme_support( 'custom-header', $args ); /*End*/
Explanation – In the above code we have enabled the Custom Header feature and provided the width, height and also the default image location to the header image.
Open your theme ‘header.php’ file and add the below code where you want the custom header to show.
Now the site owners can upload the image from the ‘Appearance > Header’ section and can use for changing their website logo.