Warning: Trying to access array offset on false in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 216
get_custom_header() - 获取自定义页眉图像数据 - WordPress函数 - WordPress动力
当前浏览:首页 / WordPress函数 / get_custom_header()

get_custom_header()

获取自定义页眉图像数据


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 "ad136aa67883594a06876e6ad38e8a8c" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

custom

headermore...


返回

(object)



源码

查看源码 官方文档


更新日志

版本描述
3.4.0开始引入

使用示例

  • 示例1

    如果要获取具有不同图像尺寸的自定义页眉,请使用函数get_custom_header()而不是get_header_image(),因为返回的对象具有attachment_id值。

    $custom_header = get_custom_header();
    if ( ! empty( $custom_header->attachment_id ) ) {
    	$image = wp_get_attachment_image_url( $custom_header->attachment_id, 'image-size' );
    }