has_custom_header

函式
has_custom_header ( No parameters )
返回值
  • (bool) True if a custom header is set. False if not.
定義位置
相關方法
get_custom_headeradd_custom_image_headerthe_custom_header_markuphas_custom_logoget_custom_header_markup
引入
4.7.0
棄用
-

has_custom_header – 這是一個WordPress函式,用於檢查當前主題是否已經定義了一個自定義頭像。自定義頭像是一個允許使用者上傳自定義圖片或標誌作為網站頭像的功能。如果當前主題中已經定義了自定義頁首,函式has_custom_header返回true。

檢查是否設定了自定義頁首。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function has_custom_header() {
if ( has_header_image() || ( has_header_video() && is_header_video_active() ) ) {
return true;
}
return false;
}
function has_custom_header() { if ( has_header_image() || ( has_header_video() && is_header_video_active() ) ) { return true; } return false; }
function has_custom_header() {
	if ( has_header_image() || ( has_header_video() && is_header_video_active() ) ) {
		return true;
	}

	return false;
}

常見問題

FAQs
檢視更多 >