Forums

How to Apply Multiple Style Sheets to One Blog (8 posts)

  1. elraymundo
    Member
    Posted 5 years ago #

    Hello all,

    I am using the Maple Leaf theme and would like to apply multiple style sheets. My goal is to use Maple Leaf to run not only my blog, but my web site (with static pages) and I would like different style sheets to apply to different sections of my web site. Can anyone help me? I've been reading and querying and am stumped. Here is my site: http://www2.teamraymond.com

    Thanks!

  2. moshu
    Member
    Posted 5 years ago #

    By "static pages" you mean Pages created by WP in Write > Write Pages? or totally non-WP files?

  3. elraymundo
    Member
    Posted 5 years ago #

    Moshu, thanks for responding!

    I'd like to create the pages in WP, Write > Write Pages.

    But then I get stuck with how to apply different style sheets to each section of pages (as well as different masthead graphics, etc.)

  4. moshu
    Member
    Posted 5 years ago #

    Well, one way might be to have different Page Templates for your "sections" (how mmany of them?) -
    On the other hand: if you plan to have a different stylesheets, that will be something different than the theme you are using... so, you started to loose me here :)

  5. Mark (podz)
    Support Maven
    Posted 5 years ago #

    Here is some header info.
    This all goes in header.php

    Change PAGE header:

    <?php if(is_page()) : ?>
    <img src="/images/header-page.jpg" />
    <?php elseif(is_page('this-page') : ?>
    <img src="/images/this-page.jpg" />
    <?php elseif(is_page('that-page') : ?>
    <img src="/images/header-that-page.jpg" />
    <?php else : ?>
    <img src="/images/header.jpg" />
    <?php endif; ?>

    ----------------------------------------

    Change CAT header:

    <h1 id="header"
    class="<?php if(is_home()) echo('header1');
    elseif(is_category('Dogs') ) echo('header2');
    elseif(is_category('Cats') ) echo('header3');
    elseif(is_category('VanillaDietCoke') ) echo('header4');
    elseif(is_single()) echo('header5');
    elseif(is_page())echo('header6'); ?>">
    <a href="<?php bloginfo('url'); ?>">
    <?php bloginfo('name'); ?></a></h1>

    in the css
    h1.header1 {
    background-image: url('http://www.tamba2.net/banner.jpg');
    background-repeat:no-repeat;
    height: 145px;
    }

    repeat as needed for the header stuff.

  6. elraymundo
    Member
    Posted 5 years ago #

    Ah, ok. Here, this might clear it up. :)

    I want to convert an existing site ( http://www.teamraymond.com ) from hand-written code and make it all run out of WP.

    I currently have a blog running out of WP at http://www2.teamraymond.com.

    The existing web site (not the blog) has (or will eventually have) 8 - 10 sections, such as Travel, Books, Recipes, Resumes, Photos, etc. I would like to use a different masthead graphic for each section (like in this example: http://www.teamraymond.com/slideshows.html) so that each section looks a little different from the others. I would also like to hyperlink each section's masthead graphic to the section homepage (so if you're three levels down into Photos, for example, clicking the Photos masthead would take you back to the main Photos page - like the blog masthead graphic does).

    I understand that templates are the best way to do this, but cannot figure out how to apply differnet styles to each template. I've tried a number of things, but nothing seems to work. I have created a template called recipes.php; it shows up in Write > Write Page > Page Template menu, but how do I make that template display a different masthead graphic than that listed in styles.css?

    Ok, that exhausted me. But I hope that clears up my dilemma. Thanks again for your responses!

  7. elraymundo
    Member
    Posted 5 years ago #

    Podz,

    Thanks for the detailed help! I'm parsing through that line-by-line trying to figure it out (I'm not so PHP litrate, but I'm slowly getting there).

    I hope you don't mind a couple of questions about what you wrote?

    1. Does it matter where in header.php all that code goes?

    2. Does CAT = Category? I'm sure it does, but just asking to be positive.

    3. Do I need both the PAGE and the CAT sections of code?

    4. I think I understand what is going on with the CAT code - you are assigning a different CSS style (and thus banner image) to each Category based on the name of the Category (Dogs. Cats, VanillaDietCoke, etc) correct? But how does the CAT code know if it is "looking" at the Dogs or Cats section?

    5. Does the code in PAGE mean that for every page on the site I should add an elseif statement in order to assign a banner graphic? That can't be right...

  8. kenwinstoncaine
    Member
    Posted 5 years ago #

    Any chance someone even a tiny bit more WordPress savvy than I can clarify three things about how to use Podz's code snippets for calling different header graphics for different Pages and Categories?

    1. Where in the header.php file would this fit?

    2. Does this *replace* any existing code in the header.php file (and if so, which), or is it just added?

    And, similarly, for the Stylesheet:

    3. Does this need to replace any existing code, or is it just added to the whole?

    Thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic