WordPress.org

Ready to get started?Download WordPress

Forums

css switching with dropdown (not themeswitching) possible ? - help needed (2 posts)

  1. illhome
    Member
    Posted 7 years ago #

    hi there,

    i have a theme that i have been working on now for quite some time and i am very pleased with my result sofar. lets say it is grey in gernal and uses just one colour other than grey for setting moods. anyway, it looks like i wanted it to look and by accident i noticed that other colours would fit just as well for setting different moods.

    since i would like the visitor to choose i was thinking of something like a css-switching-thing where the visitor can use a dropdown-menu and choose the css-file that will be used to display all pages now and in future until changed again.

    i found a way of getting exactly that done with javascript but it would not save cookies and therefor it did not work the way i had hoped it would.

    i would like to avoid using plugins and would like some kind of way to just switch the css file that is being used instead of having to create the theme several times in order to switch the theme where the only difference would be the damn css-file.

    i think it would be a waste of webspace if i have say 6 stylesheet files and then would have to make 6 themes directories just for the visitor to switch if it could be done by just switching the css-file which is smaller and it would not require several directories.

    any ideas on how i could manage this in a working way ?

    i found a page where it is done the way i want it but does not use a dropdown menu but that is extremly important to me. the page where it works is: http://gabis-bloghaeuschen.de/ ... on the right side there is a navigation where it says 'Style' , Dunkel, Hell, Xmas

    ^ here all that is done is the change of the stlyesheet.

    now i know how that is done because i got the code from that page and that works, but it won't work with a dropdown menu and there is my problem.

    if someone requires the code of that page as a reference to go on then i will gladly post it here.

    any help would be great, thanks.

    kind regards

  2. Jonathan Landrum
    Member
    Posted 7 years ago #

    You could still use a theme-switching plugin. Make the alternate stylesheet a new theme, referencing the main theme for all its templates, so all you'd have is a stylesheet for that theme.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.