Adding an image uploader to the customizer
Adding an image uploader to the customizer
In functions file (of theme)
//https://medium.com/@hiimerika/how-to-add-a-custom-theme-logo-in-wordpress-1d3cbb290882
add_theme_support( 'custom-logo', array(
'height' => 100,
'width' => 475,
'flex-height' => true,
'flex-width' => true,
'header-text' => array( 'site-title', 'site-description' ),
) );
place where the image will be displayed
<!--https://medium.com/@hiimerika/how-to-add-a-custom-theme-logo-in-wordpress-1d3cbb290882 -->
<?php
$custom_logo_id = get_theme_mod( 'custom_logo' );
$image = wp_get_attachment_image_src( $custom_logo_id , 'full' );
?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<img src="<?php echo $image[0]; ?>" alt=""></a>
The customizer control will be found in the “site identity” panel