My custom headers are located in the folder /parts/header/ and header selection is controlled using theme panel, so I tried write like this in my header.php but came out blank header in static front page, please advice.

if (is_front_page() ) {
   get_header( '/parts/header/header-style-11.php' );

} else {
   * loads the header template set in Theme Panel -> Header area
   * the template files are located in ../parts/header

   do_action('td_wp_booster_after_header'); //used by unique articles

1 Answer 1


You don't specify a path in get_header(), but rather a name. So for example:

get_header( 'home' );

This will load header-home.php from the main theme directory.

  • In my case header.php is in main directory and header-style-11.php is located in main-directory/parts/header/, that is the header I am trying to call. I can try placing in same directory.
    – Chito
    Mar 17, 2017 at 2:31
  • Move them into the main theme directory with style.css and give them meaningful names
    – Cedon
    Mar 17, 2017 at 2:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.