Support » Fixing WordPress » get_header('whatever') problem in child themes

  • donsony


    I am trying to replace header-whatever.php of my main theme in my child theme and by adding the file in the child theme, but wordpress is loading the file from the main theme itself. Is the second header not supported in a child theme???

    In index.php, I am using get_header(‘whatever’) to call the file.

    Anyone knows how to do this. Please help, its urgent!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • dfwgreg


    <?php include( TEMPLATEPATH . 'header-whatever.php' ); ?>

    TEMPLATEPATH = location of where your theme is located.

    You can also substitute TEMPLATEPATH with the full path to the site.

    <?php include( '/wp-content/themes/[FOLDER]/header-front.php' ); ?>

    Hope this helps,
    Gregory S.



    Thank you gregory, It works. That was simple PHP, but wouldn’t it be bypassing the wordpress provided layers of interaction? Would it result in any performance issues?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get_header('whatever') problem in child themes’ is closed to new replies.