我添加了这个自定义函数functions.php 来添加图像。
// Provider Image
function header($wp_customize){
$wp_customize->add_setting('header-image');
$wp_customize->add_control(new WP_Customize_Cropped_Image_Control($wp_customize, 'header-image', array(
'label' => 'Add Image',
'section' => 'header-section',
'settings' => 'header-image',
'width' => 426,
'height' => 642
)));
}
add_action('customize_register','header');
然后我回声
<img src="<?php echo wp_get_attatchment_url(get_theme_mod('header-image')) ?>">
定制领域的实地工作。但页面正在加载。
慕雪6442864
MMTTMM