call different headers

Posted in: Newspaper
Post count: 42

hello,
to call different instances of an ad supplier (startpage and rotation)
I have built two seperate header files, being (copied versions of the original) almost identical apart from the ad-call, of course.
while the standard header is still simply called “header.php”
I want my other header (with the startpage-call) to be used on the startpage only, so I called it “header-home.php”

Now – i put these two headers into the main folder of my childtheme – but that way only the normal header was used (also on the startpage)
So I imitated the folder structure in the newspaper folder, built a “parts”-folder and put a “header”-folder in there, where I placed my two header files header.php and header-home.php

Sadly to no avail: the “header-home.php” – file is not being used by the homepage. What am I doing wrong? How can I make this work?

Many thanks in advance

Post count: 20688

Hi,

So I understand that you want to display a different ad on the homepage, and the normal ad on all other pages. Try making that condition in the header template that you are using
https://www.screencast.com/t/YUtfVIVC8
You can use the is front page tag and create a condition in the header template
https://codex.wordpress.org/Function_Reference/is_front_page

Thanks

Post count: 42

Thank you for that – somewhere i read that building custom-headers was possible by giving them the “-site”-ending (depending on their site-title, in the given example it would have been header-home.php)…
And it did not work out as expected. Cheers!

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.