I can get the image header with
get_header_image()
ex:
wp eval "echo get_header_image();"
But how can I change that ? I tried
set_header_image(url) and Custom_Image_Header::set_header_image
with no success.
I can get the image header with
get_header_image()
ex:
wp eval "echo get_header_image();"
But how can I change that ? I tried
set_header_image(url) and Custom_Image_Header::set_header_image
with no success.
Share Improve this question asked Aug 15, 2019 at 21:23 yarekyarek 1274 bronze badges 4- are you using default theme or customized theme? – Wordpress Dev Commented Aug 16, 2019 at 4:18
- I installed a theme – yarek Commented Aug 16, 2019 at 9:13
- Which theme are u using? – Wordpress Dev Commented Aug 16, 2019 at 9:14
- Used theme: EnvestPro Lite. It is a classic theme where you set the image header in customize->theme->header – yarek Commented Aug 16, 2019 at 13:01
1 Answer
Reset to default 0get_header_image()
uses get_theme_mod()
to get the saved header image, so I would assume the following example should be used to update the saved value. And set_header_image
does the same thing at the end of it, after all the different checks.
set_theme_mod( 'header_image' , 'your-image-url-here' );
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745224728a4617407.html
评论列表(0条)