• Resolved tovlakas

    (@tovlakas)


    Hi,

    My website is dark-colored but I want some pages to be light-colored. Rather than hardcoding “#page-id-xx” into the css file for each page I add, I was hoping to create a page template file that somehow calls on these separate colors so that when I set a page as this page template, it automatically changes to the proper, lighter color scheme.

    How do I accomplish this? Since the body background and header images and whatnot are called in the header.php file, I would likely need to create an alternative header file and in my alternate page template, call that second header file instead of the original? Does that sound right?

Viewing 5 replies - 1 through 5 (of 5 total)
  • tutorial

    from your “page.php” save it as “lighter_page.php”

    Change this located at the top.
    <?php get_header(); ?>

    make it say this

    <?php
    /*
    Template Name: Whatever you want
    */
    get_header(); ?>

    Set your page to the right template in the admin area and add a different class to the page so that you can style it in the styles.css

    Thread Starter tovlakas

    (@tovlakas)

    Thanks, but I already knew how to do that… that doesn’t address the issue I have because my entire page is going to be lighter colored, including the header. If I have a call for the header in there, it’s going to pull in the original header image, original page background image, and original stylesheet.. so is there a way to specify a call to an alternative header file?

    How do you add a different class to that new template?

    Make a new header I guess….call it like newHeader.php

    Copy your header.php, change the stuff you neeed to

    swap
    <?php get_header(); ?>

    for
    <?php include (TEMPLATEPATH . "/newHeader.php"); ?>

    maybe? (this is all theoretical of course….I’m still learning)

    Thread Starter tovlakas

    (@tovlakas)

    Note, I ended up just making a template file that didn’t call the header, and had to manually add the alternative header into the template itself… oh well.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Completely change the CSS on one Page Template?’ is closed to new replies.