the_custom_logo( int $blog_id )

Displays a custom logo, linked to home.


Description Description


Parameters Parameters

$blog_id

(int) (Optional) ID of the blog in question. Default is the ID of the current blog.


Top ↑

Source Source

File: wp-includes/general-template.php

function the_custom_logo( $blog_id = 0 ) {
	echo get_custom_logo( $blog_id );
}

Top ↑

Changelog Changelog

Changelog
Version Description
4.5.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 3 content
    Contributed by joshcanhelp

    Add your custom logo to the login page:

    function wpdev_filter_login_head() {
    
    	if ( has_custom_logo() ) :
    
    		$image = wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ), 'full' );
    		?>
    		<style type="text/css">
    			.login h1 a {
    				background-image: url(<?php echo esc_url( $image[0] ); ?>);
    				-webkit-background-size: <?php echo absint( $image[1] )?>px;
    				background-size: <?php echo absint( $image[1] ) ?>px;
    				height: <?php echo absint( $image[2] ) ?>px;
    				width: <?php echo absint( $image[1] ) ?>px;
    			}
    		</style>
    		<?php
    	endif;
    }
    
    add_action( 'login_head', 'wpdev_filter_login_head', 100 );
    

You must log in before being able to contribute a note or feedback.