New Page template does not work (5 posts)

  1. kmessinger
    Forum Moderator
    Posted 6 years ago #

    My new page template works fine with this call, <?php get_header(); ?> but not with this call (I get a blank Page), <?php get_header2(); ?>.

    I have renamed "header" to "header2" to test and once the name changes it does not work.

    How do I get header2 to work? Do I need to add something to functions.php?

  2. Clayton James
    Posted 6 years ago #

    Does it need to be expressed a little differently? I only pose that as a question because I am not sure myself.

    <?php get_header( $name ); ?>

    Reference: http://codex.wordpress.org/Function_Reference/get_header

  3. kmessinger
    Forum Moderator
    Posted 6 years ago #

    Thanks Clayton, I used that from the codex as well putting the file name, header2.php where the $name was but it still brought up the default header.

    I am now using a plugin for dynamic headers, http://nicasiodesign.com/blog/category/wordpress-plugins/. I probably should have done this right-off instead of wasting a rainy day.

    This lets me change the image although I wanted to change some info in the header itself like some of the meta.

  4. Clayton James
    Posted 6 years ago #

    I bookmarked the link. It might come in handy in the future. Thanks!

  5. MichaelH
    Posted 6 years ago #

    Just for info:

    get_header('myheader'); // will include header-myheader.php
    get_footer('myfooter'); // will include footer-myfooter.php
    get_sidebar('mysidebar'); // will include sidebar-mysidebar.php

Topic Closed

This topic has been closed to new replies.

About this Topic