Multiple theme same site

Discussion in 'HTML & Website Design' started by collegemd, Sep 14, 2008.

  1. #1
    Hello-

    I am trying to add multiple themes to my site. I would like my users to able to pick which theme is best for theme. I know it can be accomplished but I do not know how. Any suggestions would be great. My site is very very much CSS dependent in terms of design.

    Thanks!
     
    collegemd, Sep 14, 2008 IP
  2. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Stylesheet switching is usually handled by javascript. In which case, the files are available to peruse on the net. Find a site (such as a WP demo theme site) and open up the javascript file that is used to do the switching.

    There are numerous scripts and tutorials out there, but most notably are:

    A List Apart: Working With Alternate Style Sheets
    A List Apart: Invasion of the Body Switchers
    Dynamic Drive: Style Sheet Switcher

    If you want the style to 'stick' for the visitor, then you will need to employ cookies. When your visitor switches styles, the cookie gets set to make note of which style was selected.

    Look at CSS Stylesheet Switcher using PHP (Javascript free) for information on how this is accomplished.
     
    Dodger, Sep 14, 2008 IP
  3. fireworking

    fireworking Peon

    Messages:
    460
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    There are many examples in google. You could always try google
     
    fireworking, Sep 14, 2008 IP
  4. collegemd

    collegemd Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks! I have done many searches in Google but did not know what it was called. So every time I searched I got the wrong results. This will help tremendously.
     
    collegemd, Sep 14, 2008 IP
  5. twistedspikes

    twistedspikes Notable Member

    Messages:
    5,694
    Likes Received:
    293
    Best Answers:
    0
    Trophy Points:
    280
    #5
    You could do it working with JavaScript to "switch" style sheets at the click of a link, store a cookie about it so they see that theme going through the whole site.

    But then each theme would need to have the same coding structure.
     
    twistedspikes, Sep 14, 2008 IP
  6. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Not necessarily. If using PHP, one could have entirely different layouts altogether. Heck, with Zend Framework's layout features, it makes it very easy to do (if you are into MVC at all)
     
    Dodger, Sep 14, 2008 IP