Title: has_custom_logo
Published: April 12, 2016
Last modified: August 20, 2026

---

# has_custom_logo( int $blog_id ): bool

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#wp--skip-link--target)

Determines whether the site has a custom logo.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#parameters)󠁿

 `$blog_id`intoptional

ID of the blog in question. Default is the ID of the current blog.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#return)󠁿

 bool Whether the site has a custom logo or not.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#source)󠁿

    ```php
    function has_custom_logo( $blog_id = 0 ) {
    	$switched_blog = false;

    	if ( is_multisite() && ! empty( $blog_id ) && get_current_blog_id() !== (int) $blog_id ) {
    		switch_to_blog( $blog_id );
    		$switched_blog = true;
    	}

    	$custom_logo_id = get_theme_mod( 'custom_logo' );
    	$is_image       = ( $custom_logo_id ) ? wp_attachment_is_image( $custom_logo_id ) : false;

    	if ( $switched_blog ) {
    		restore_current_blog();
    	}

    	return $is_image;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/general-template.php#L1238)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/general-template.php#L1238-L1254)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#related)󠁿

| Uses | Description | 
| [get_theme_mod()](https://developer.wordpress.org/reference/functions/get_theme_mod/)`wp-includes/theme.php` |

Retrieves theme modification value for the active theme.

  | 
| [wp_attachment_is_image()](https://developer.wordpress.org/reference/functions/wp_attachment_is_image/)`wp-includes/post.php` |

Determines whether an attachment is an image.

  | 
| [switch_to_blog()](https://developer.wordpress.org/reference/functions/switch_to_blog/)`wp-includes/ms-blogs.php` |

Switches the current blog.

  | 
| [restore_current_blog()](https://developer.wordpress.org/reference/functions/restore_current_blog/)`wp-includes/ms-blogs.php` |

Restores the current blog, after calling [switch_to_blog()](https://developer.wordpress.org/reference/functions/switch_to_blog/) .

  | 
| [is_multisite()](https://developer.wordpress.org/reference/functions/is_multisite/)`wp-includes/load.php` |

Determines whether Multisite is enabled.

  | 
| [get_current_blog_id()](https://developer.wordpress.org/reference/functions/get_current_blog_id/)`wp-includes/load.php` |

Retrieves the current site ID.

  |

[Show 2 more](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#)

| Used by | Description | 
| [get_custom_logo()](https://developer.wordpress.org/reference/functions/get_custom_logo/)`wp-includes/general-template.php` |

Returns a custom logo, linked to home unless the theme supports removing the link on the home page.

  | 
| [get_body_class()](https://developer.wordpress.org/reference/functions/get_body_class/)`wp-includes/post-template.php` |

Retrieves an array of the class names for the body element.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 3 content](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#comment-content-1795)
 2.    [Anthony Hortin](https://profiles.wordpress.org/ahortin/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/has_custom_logo/#comment-1795)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fhas_custom_logo%2F%23comment-1795)
     Vote results for this note: 1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fhas_custom_logo%2F%23comment-1795)
 4.  See Also
      [the_custom_logo()](https://developer.wordpress.org/reference/functions/the_custom_logo/)
     [get_custom_logo()](https://developer.wordpress.org/reference/functions/get_custom_logo/)
 5.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fhas_custom_logo%2F%3Freplytocom%3D1795%23feedback-editor-1795)
 6.   [Skip to note 4 content](https://developer.wordpress.org/reference/functions/has_custom_logo/?output_format=md#comment-content-2160)
 7.    [Rami Yushuvaev](https://profiles.wordpress.org/ramiy/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/has_custom_logo/#comment-2160)
 8.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fhas_custom_logo%2F%23comment-2160)
     Vote results for this note: -5[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fhas_custom_logo%2F%23comment-2160)
 9.  To get the URL of the custom logo image:
 10.     ```php
         $custom_logo_id = get_theme_mod( 'custom_logo' );
         $image = wp_get_attachment_image_src( $custom_logo_id , 'full' );
         echo $image[0];
         ```
     
 11.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fhas_custom_logo%2F%3Freplytocom%3D2160%23feedback-editor-2160)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fhas_custom_logo%2F)
before being able to contribute a note or feedback.