HTTP/2 301
server: nginx
date: Sun, 12 Oct 2025 03:44:43 GMT
content-type: text/html; charset=UTF-8
x-olaf: ⛄
vary: accept, content-type
x-redirect-by: WordPress
location: https://developer.wordpress.org/reference/functions/has_custom_logo/
x-frame-options: SAMEORIGIN
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 1
HTTP/2 200
server: nginx
date: Sun, 12 Oct 2025 03:44:44 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
vary: accept, content-type
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 1
has_custom_logo() – Function | Developer.WordPress.org
has_custom_logo( int $blog_id ): bool
Determines whether the site has a custom logo.
$blog_id
intoptionalID of the blog in question. Default is the ID of the current blog.
bool Whether the site has a custom logo or not.
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 View on Trac View on GitHub
Version | Description |
---|
4.5.0 | Introduced. |
See Also
the_custom_logo()
get_custom_logo()
To get the URL of the custom logo image: