trying to use "get" tag to pull file

Discussion in 'PHP' started by MrMoolah.com, Jul 17, 2008.

  1. #1
    have a small problem, i have a wordpress blog and currently when i create a page i tell it to pull the header
    <?php get_header(); ?>
    Code (markup):
    , but i have created a different header and labeled it header1, so i used this code
    <?php get_header1(); ?>
    Code (markup):
    but for some reason its not pulling the file, and instead it is has this error
    
    Fatal error: Call to undefined function get_header1() in /home/content/s/b/u/sbuell20/html/wp-content/themes/TechBlog/phpld.php on line 7
    
    Code (markup):
    . So i guess im wondering whether i need to put code somewhere other than on the page in order to pull the header1.php file or what. Help would be great. thanks!
     
    MrMoolah.com, Jul 17, 2008 IP
  2. mbreezy

    mbreezy Active Member

    Messages:
    135
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #2
    I don't know WP TOO much as I only have a couple sites with it, but I would imagine just copy/paste the get_header() function right next to the original, make the slight change, and then change the code within.

    Like I said though, I don't have it all mapped out in my head.
     
    mbreezy, Jul 17, 2008 IP
  3. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Replace <?php get_header(); ?> with <?php include (TEMPLATEPATH . '/header1.php'); ?>

    Treat include tags like functions, not includes. This explains it in more detail:
    Wordpress Include Tags
     
    Cash Nebula, Jul 17, 2008 IP
    MrMoolah.com likes this.
  4. MrMoolah.com

    MrMoolah.com Well-Known Member

    Messages:
    579
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    108
    #4
    Thanks to both of you for responding, Cash Nebula way worked. Thanks a million.
     
    MrMoolah.com, Jul 17, 2008 IP