WordPress.org

Ready to get started?Download WordPress

Forums

get_header('whatever') problem in child themes (3 posts)

  1. donsony
    Member
    Posted 2 years ago #

    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!!!

  2. dfwgreg
    Member
    Posted 2 years ago #

    <?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.

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

    Hope this helps,
    Gregory S.

  3. donsony
    Member
    Posted 2 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic