get_custom_header_markup

函数
get_custom_header_markup ( No parameters )
返回值
  • (string) The markup for a custom header on success.
定义位置
相关方法
the_custom_header_markupget_custom_headerget_compat_media_markupget_random_header_imagehas_custom_header
引入
4.7.0
弃用
-

get_custom_header_markup: 这个函数返回当前主题的自定义页眉的HTML标记。它可以用来在网站的前端显示页眉。

检索自定义页眉的标记。

容器div将总是在自定义器的预览中被返回。

function get_custom_header_markup() {
	if ( ! has_custom_header() && ! is_customize_preview() ) {
		return '';
	}

	return sprintf(
		'<div id="wp-custom-header" class="wp-custom-header">%s</div>',
		get_header_image_tag()
	);
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 20:33:00

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: