has_header_image()判断当前主题是否设置了头部图像

目录

描述

Check whether a header image for the current theme is set or not.

has_header_image() 描述

用法

<?php has_header_image() ?>

has_header_image() 用法

参数

None.

has_header_image() 参数

返回值

(bool) 

Returns true if a header image has been set, otherwise false if:

  • The current theme does NOT support header images. (Learn how to enable it in Custom Headers page).
  • The current theme DOES support header images. However, the user has selected the "Remove Header Image" option from the Appearance -> Header screen.

has_header_image() 返回值

示例

has_header_image() 示例

历史

添加于 版本: 4.2.0

has_header_image() 历史

源文件

has_header_image() 函数的代码位于 wp-includes/theme.php.

has_header_image() 源文件