add_theme_support( 'custom-logo' );
if ( function_exists( 'the_custom_logo' ) ) {
the_custom_logo();
}
Set logo from appearance->customize->site identity->site title & logo setting->change image->publish
if ( function_exists( 'the_custom_logo' ) ) {
the_custom_logo();
}
function themename_custom_logo_setup() {
$defaults = array(
'height' => 100,
'width' => 400,
'flex-height' => true,
'flex-width' => true,
'header-text' => array( 'site-title', 'site-description' ),
);
add_theme_support( 'custom-logo', $defaults );
}
add_action( 'after_setup_theme', 'themename_custom_logo_setup' );
/*LOGIN CODE*/
function add_login_logo() { ?>
<style type="text/css">
#login-designer-logo, body.login #login h1 a {
background-image: url(<?php echo get_home_url()?>/wp-content/uploads/2021/07/Logo-Water-Tree.png) !important;
}
</style>
<?php }
add_action( 'login_enqueue_scripts', 'add_login_logo' );