Forums

[resolved] Calling Different Headers (4 posts)

  1. bradstinyworld
    Member
    Posted 6 months ago #

    I am doing something wrong, but I don't know what. I am trying to write a theme that calls one header on the index.php and a different one for single.php. The headers are named respectively header1.php and header2.php.

    I have tried substituting the call function with the appropriate file name but when I load the blog I get a fatal error. On index.php I start out with
    line 1<blockquote><?php get_header1(); ?></blockquote>

    When i load the blog in a browser I get:

    Fatal error: Call to undefined function get_() in C:\xampplite\htdocs\wtf\wp-content\themes\WTF\index.php on line 1

  2. bradstinyworld
    Member
    Posted 6 months ago #

    for the record there are now blockquotes around code in the theme...

  3. csleh
    Member
    Posted 6 months ago #

    I am not an expert but have you tried

    <?php include ('sidebar2.php'); ?>

    using an include instead of get-header

    I think that's how you pull in non-wordpress-standard page names.

    Probably also you need this bit of code on top of each custom header page with the appropriate name

    <?php
    /*
    Template Name: Archives with Content
    */
    ?>
  4. bradstinyworld
    Member
    Posted 6 months ago #

    Thank You! That seemed to do the trick.

Reply

You must log in to post.

About this Topic