WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to make the css switcher from alistapart work on WordPress (8 posts)

  1. CtiaKitahara
    Member
    Posted 7 years ago #

    Hi everyone,

    I have a website with a css switcher. I have seven different stylesheets. I used the code from the site alistapart which worked just fine but now that I'm using WordPress I don't know how to make it work anymore. I created my theme and put the original style in it. The other ones I put in a folder in the root of the site, it seemed to work because the color scheme changes, but it doesn't show the images. Where should I place them to make it work? Please, somebody help me!!! It's really urgent because the site was already online when I decided to use WordPress. I tried to download a plugin, but the only one I found lets me use just 6 stylesheets, I need 7!!! Help, please!!!

  2. pizdin_dim
    Member
    Posted 7 years ago #

    "Please, somebody help me!!! It's really urgent because the site was already online when I decided to use WordPress."

    Relax, your site still works fine without the styleswitcher. If it really IS as urgent as you say, try the WP-PRO mailing list.

  3. Andrew Ozz
    WordPress Dev
    Posted 7 years ago #

    In WP the stylesheets go into your theme's directory and images used in them usually go into "images" directory in your theme. You will probably have to change the javascript a bit to make it all work.

  4. CtiaKitahara
    Member
    Posted 7 years ago #

    The thing is I'm not a programmer.
    I visited a list apart site and I found the php switcher that is better than the java script one, but the problem is I don't know how to put it in the wordpress because the code goes exactly in the same place as the wordpress tag to call the stylesheet.
    Does anybody knows how to solve this?
    Thanx,

  5. CtiaKitahara
    Member
    Posted 7 years ago #

    Guys,
    I've just found the solution!!! I'm very happy!!! I found it here in another topic.
    Thank you very much!!

  6. christophdollis
    Member
    Posted 6 years ago #

    Umm, CtiaKitahara... not to put too fine a point on it, but can you share the solution?

    Or at least tell me where I might find it?

    "I've just found the solution!!! I'm very happy!!!"

    ... is great, but not very helpful to me!

    Pretty please?

  7. christophdollis
    Member
    Posted 6 years ago #

    The answer has been founded on the www!

    This woman is a genius web designer (I love her site) and if anyone wants to use A List Apart's ULTRA simple and effective PHP stylesheet switcher, no Javascript or plugin required, the answer's here:

    jet2k.com

  8. CtiaKitahara
    Member
    Posted 6 years ago #

    Sorry, Christophdollis,

    I was very selfish not sharing the solution I found. But, please don't get me wrong. Since I found the solution on this very same forum, I thought that others could also find it easily, and that I was just being a bit slow.

    Anyway, here it goes the solution I found. It was very very simple, you just need to put the alternate stylesheets in your theme's folder and add the template tag <?php bloginfo('template_directory'); ?> to the path to it. The code will look like this in the header of your theme:
    <link href="<?php bloginfo('template_directory'); ?>/youralternatestylesheet.css" rel="alternate stylesheet" type="text/css" title="youralternatestylesheettitle" />

Topic Closed

This topic has been closed to new replies.

About this Topic