• i created a theme and wanted to provide alternate stylesheets for readers. at current, the head of the theme looks like this:

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" />

    i understand that calls the style.css from the theme directory and applies it to the template.

    i tried following the ala javascript stylesheet switch tutorial and am having problems. i replaced the above with the following just to test:

    <link rel="stylesheet" type="text/css" href="style.css" />

    when i refresh the page i am presented with an unstyled page.

    i’m testing all of this locally with wp 2.0, wamp, and winxp.

Viewing 10 replies - 1 through 10 (of 10 total)
  • What is an alternate stylesheet?
    Can’t you just put the “alternate” stylesheet in its own directory (as a theme!) an defining the template in the head section:
    /*
    Template: original
    Theme Name: alternate
    ...

    and it will leave as “parasite” theme using the original templates – and you can just use the theme switcher plugin to offer the readers an option to switch themes.

    Thread Starter unfortunate

    (@unfortunate)

    i don’t think im following? won’t doing that inherit the template of the default theme installed with wordpress?

    i tried the theme switcher plugin. i didn’t like the list or the drop down menu. i wanted to be able to place two links near the top of the blog.

    Scrap it.
    You are on wp.com. I think there is no way to have your own theme.
    Plus, their support forum is here:
    http://wordpress.com/forums/

    Thread Starter unfortunate

    (@unfortunate)

    no no.. this is for a dedicated wordpress install. i know wp.com does not allow customizations.

    OK, then we are back in the game 🙂

    So, You can have a “theme” that has only a style.css file in the directory with its name.

    Defining what template to use, as I gave the example above, it will work with all the template files from that theme.

    So, let’s say your original theme is called “unfortunate” and you create an alternate stylesheet for it.
    Now you put this second stylesheet in its own (theme)folder, let’s call it “fortunate” and at the top of the stylesheet you define:
    Template: unfortunate
    it will work as a separate theme with all the colours, fonts, bg images defined in the second stylesheet, BUT using all the template files from the theme you have defined in the line above.

    Thread Starter unfortunate

    (@unfortunate)

    so this second ‘theme’ folder which contains the second stylesheet goes in the original unfortunate directory?

    Nope. In its own direvtory under wp-content/themes/second* folder.
    Just put that line at the top of the stylesheet – otherwise it will not work.

    *- “second” stands for whatever you choose to name your alternate style/theme.

    Thread Starter unfortunate

    (@unfortunate)

    ok. do you know how i could display the different themes without having to use the list or drop down menu? i tried display: inline but that didn’t work.

    You can delete all the other themes and have only the two that you made. Wouldn’t that work?

    The other thing you can try.
    Leave the plugin activated, but remove the call for it from the sidebar.
    Now, before removing the call, check out what is shown in your toolbar when hovering the links, and then hardcode the two links into your sidebar.

    Thread Starter unfortunate

    (@unfortunate)

    thanks. that works for now. overkill for what i needed but i guess it provides the option for me to change each themes structure independently.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Linking stylesheet to theme’ is closed to new replies.