1
votes

I have created a custom page template for my wordpress theme that uses a custom header-file:

get_header('custom');

Everything works as expected, but when I set a page to be the Posts-Page somehow the standard header-file gets loaded instead (my custom page template is activated).

I have also tried to override the blog.php from the parent and added the explicit call to my custom header-file, but it didn't have any effect.

What am I doing wrong? How does this work?

2
What's the file name of you custom header file? - Mangesh Parte
"header-custom.php" - as I said it works, just not on the posts-page. - Đinh Carabus
Oh I see. Can you please show me the code of single.php - Mangesh Parte
I didn't override single.php in my child theme. The single.php from the parent says set_header(); but even if I do override it with my own version it still doesn't work :| - Đinh Carabus
got it! I had to override home.php. Thanks for your support! - Đinh Carabus

2 Answers

3
votes

You should override home.php

A bit more information home.php is the template used for the blog homepage (the page with all blogposts). You can learn more about which templates are being used where in the template hierarchy documentation: http://codex.wordpress.org/Template_Hierarchy

1
votes

The solution was to override home.php.