How to set up a page specific header background image?
Posted: Wed Nov 12, 2025 11:36 am
Hi all,
I want to use page specific header background images.
The general image ist defined in the header.php, included in the /mytheme/index.php:
I thought the easiest way would be to have a user defined field that could be filled via the settings > options tab when editig a (static) page like the 'template' field that I use:
It didn't work as in the /mytheme/index.php, the header.php ist included before the user defined fields of the page are read. I concluded that this procedure is rather targeted to the content of the page, not the style.
How could I influence the style of the <header> background after the page template is loaded?
Thanks in advance for help.
I want to use page specific header background images.
The general image ist defined in the header.php, included in the /mytheme/index.php:
Code: Select all
<header style="background: black url(https://mydomain/bl-themes/mytheme/img/image.png);">Code: Select all
"header-img": {
"type": "string",
"placeholder": "Background image in header"
}
How could I influence the style of the <header> background after the page template is loaded?
Thanks in advance for help.