I have created a template in wordpress for the home page, named: page-home-slider.php
I have chosen the home page to take that custom template.
Until here everything works fine.
Then I have created header-home.php, so a custom header for my home page.
Then in page-home-slider.php I have coded: get_header(“home”);
Now, when I access the home page from browser, the default header is displayed first and under it, my custom header. Is this normal? I wanted to have just my custom header. Please tell me what I am doing wrong.
PS: I am using JobRoller template if it matters somehow.
As discussed in the comments, you could set a condition in
header.php
that checks if the requested page has the template using theis_page_template()
function:header.php
Still, you need to check where
get_header()
is getting called to avoid duplicates.Reference: https://developer.wordpress.org/reference/functions/is_page_template/