Warning: Trying to access array offset on false in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 216
has_custom_logo() - 网站是否有自定义logo - WordPress函数 - WordPress动力
当前浏览:首页 / WordPress函数 / has_custom_logo()

has_custom_logo( int $blog_id )

网站是否有自定义logo


Warning: Undefined array key -1 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 185

Warning: Undefined array key 3 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 186

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "454f244433028bd9efcbe148a4e72acd" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "68cbf86a6adef9731b41f24cf8261f7c" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "29ee66fe7549f2ae796e2579d52d0508" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

custom

has 判断有more...

logo


参数

$blog_id

(int) (可选) 相关博客的ID,默认值是当前博客的ID。


返回

(bool) 网站是否有自定义logo



源码

查看源码 官方文档


更新日志

版本描述
4.5.0开始引入

使用示例

  • 示例1
  • 示例2

    要获取自定义logo图像的URL:

    $custom_logo_id = get_theme_mod( 'custom_logo' );
    $image = wp_get_attachment_image_src( $custom_logo_id , 'full' );
    echo $image[0];