Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS HELP! Different style sheets for different pages?

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #29440

    Hey guys,

    Could some one help me out or direct me to a tutorial or something on how to create a different style sheet for sub pages so the background image on the index page doesn’t go through out the entire site? I’m not exactly sure how to create this??

    Link to site:
    http://nickswenson.com/

    Thanks,
    Nick

    #77846
    nutt318
    Member

    I would duplicate your header.php file and rename it to header2.php and in there tell it a different style sheet to use. Then create a new template for a page. In that template page set header2.php to be included instead of the default header. Then go to your page that you created in wordpress and set the page template to the new one you made which includes the header2.php file.

    I think this will work and hopefully I explained it well enough, if not I can provide more info.

    Jake

    #69056
    "nutt318" wrote:
    I would duplicate your header.php file and rename it to header2.php and in there tell it a different style sheet to use. Then create a new template for a page. In that template page set header2.php to be included instead of the default header. Then go to your page that you created in wordpress and set the page template to the new one you made which includes the header2.php file.

    I think this will work and hopefully I explained it well enough, if not I can provide more info.

    Jake

    Thanks, Jake! You lost me tough on the template thing…could you explain that better?

    #78358
    nutt318
    Member

    Sure, I think you can just copy your index.php (maybe pape.php) but try index.php first. Once you have a copy of index.php change the name to something like secondstyle.php.

    Then open the secondstyle.php and at the very top add the following code.

    Code:

    Just save the file and go into the admin area of wordpress. Then go to your ‘pages’ section and the click on the page you want to have a different style sheet. Then when your in the edit area of this page on the left bottom of the page you will be able to choose the new template file called ‘Second Style Sheet’.

    The just save, and now that page when loaded should have that stylesheet you specified.

    Also if that doesnt work you may need to copy a different page instead of index.php, and maybe do page.php. Someone else may know better.

    Let me know if it works for you or if you have any other questions.

    #78605
    azazul
    Participant

    Why would you need to change the whole css file just to change site background ?!?!?
    Change only ID on <body> tag, but use the same css file.

    #78611
    virtual
    Participant

    I do think that Azazul has a point, just give each body tag a class to change the background.

    This is not related to your question, but I think you need to address the navigation which I noticed in your previous post. There is no rollover on the text and the menu does not dropdown on rollover. It requires 2 clicks from the small arrow to get to a page even if there is only one, and that is not very user friendly. :cry:

    #81683

    Navigation issue corrected. Thanks for the suggestions, guys!!

    Nick

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.