Page 1 of 1

How to set up a page specific header background image?

Posted: Wed Nov 12, 2025 11:36 am
by Fleetenkieker
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:

Code: Select all

<header style="background: black url(https://mydomain/bl-themes/mytheme/img/image.png);">
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:

Code: Select all

 "header-img": {
        "type": "string",
        "placeholder": "Background image in header"
    }
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.

Re: How to set up a page specific header background image?

Posted: Sat Jan 17, 2026 9:46 pm
by Edi
You can define if-conditions in the index.php of the theme.