• Resolved michellecoop

    (@michellecoop)


    I have a theme that I created using Artiseer. I will have various pages on my site. What I’d like to do is for certain pages to have their own header and color scheme. I know that I have to add `<?php
    /*
    Template Name: New Page
    */
    ?>` so that I am able to designate a file a page template.

    But what I do not understand and cannot seem to find clear instructions on, is how to ensure that when I select a page theme, that the color scheme and header changes along with it.

    I see in the write/edit pages, you can use the drop down menu to select a page theme, only if the above code is inserted in the file, but I have been working HOURS on trying to find out where to give the style info for the color scheme/header.

    Thank you for reading. ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • In your Page Template, replace
    <?php get_header(); ?>
    with
    <?php include (TEMPLATEPATH . '/myheader.php'); ?>

    Thread Starter michellecoop

    (@michellecoop)

    Can I point to a header.php in a different folder?

    For example…my theme is themeA and under this, I have another theme, say themeA-1. Can I point it to say
    `<?php
    /*
    Template Name: ThemeA-1
    */
    ?>
    <?php include (TEMPLATEPATH . ‘/themeA-1/header.php’); ?>

    Thank you for your response. I am pulling my hair out trying to figure this out. Am I going in the wrong direction with what I posted here?

    You’d probably need something like WP_CONTENT_DIR

    <?php include (WP_CONTENT_DIR . '/themes/themeA-1/header.php'); ?>

    Thread Starter michellecoop

    (@michellecoop)

    This page template…ThemeA-1.php would be under my themeA directory, correct?

    Thanks. It’s not working right yet…hehe. I’m through for tonight. ?? I need to leave and come back…maybe this will make sense to me later.

    Much appreciated responses though. Have a good one MichaelH!

    WP_CONTENT_DIR on my host is /home/dfdg/public_html/wp-content so to include the WordPress Default themes footer in another theme use:

    <?php include (WP_CONTENT_DIR . '/themes/default/footer.php'); ?>

    How do I tell the page which header to have? It seems that they only way that I can select a Template is from the “Quick Edit” area and when you click on “Default Template” – there’s nothing there.

    Thanks,
    Gedy

    @lifetreecreative
    You can create a Page Template, then in that Page Template use the template tag, get_header() or use an include statement as is shown above. After you create the Page Template assign it to a Page.

    Other resources to review:
    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy

    Create header2.php with whatever you want in it. In your template, insert <?php get_header2(); ?> instead of <?php get_header(); ?>

    Thread Starter michellecoop

    (@michellecoop)

    Hmm, I got it to work…sort of. If I view the pages in Firefox, it works fine, but if I go to Internet Explorer, the content goes to the left (when it normally goes centered).

    The coding in my files are all the same, but point to different themes depending on the page.

    Geez…this is frustrating!!!

    hehe thx for the help.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Creating theme that has different page templates’ is closed to new replies.