WordPress.org

Ready to get started?Download WordPress

Forums

Alternate stylesheets in the new paradigm (6 posts)

  1. TechGnome
    Moderator
    Posted 9 years ago #

    Ok, with the new theme structure, calling a stylesheet is as simple as calling: bloginfo('stylesheet_url');

    Which is all fine and dandy.... but now I want to add an alternate stylesheet to the site. If it was jsut for me, then I would simply hard-code the link to it.... but I'd like to release this a *some* point... and a hard codded url to it just isn't kosher. So.... is there away t odo it dynamicaly?

    Tg

  2. oriecat
    Member
    Posted 9 years ago #

    Do you mean like to use as a style switcher, or a specific stylesheet for a certain category or page, or what?

  3. moshu
    Member
    Posted 9 years ago #

    TG, you can make a "theme" that consist just by 1 file: style.css
    The trick is to put at the top part the template name used, e.g.
    /*
    Template: classic
    Theme Name: TG's theme
    Description: Wonderful
    Author: TG
    Author URI: http://example.com

    */
    Just replace "classic" with whatever theme will be using this style.

  4. TechGnome
    Moderator
    Posted 9 years ago #

    Not be snarky.... but that's Not what I wanted....
    In Fx, I can (in theory, and I've done it in other sites) select the view menu, then select Page Style, and select the primary or one or more alternate styles..... Fx picks them up through link tags that are set to "alternate stylesheets" .... only 1) I can't get mine working right... and 2) I've thought about shipping both style with the one theme.

    Tg

  5. TechGnome
    Moderator
    Posted 9 years ago #

    for the time being, I'm harding the alternate stylesheet url, but I think I found why they aren't showing in Fx in the first place.... according to this I need to give them names (title)...

    Tg

  6. TechGnome
    Moderator
    Posted 9 years ago #

    Well, I've figured out how to properly link them so that Fx will see them. As for including it in the theme, I'll jsut include the CSS file and let whom ever decide which one to use (by renaming the file).

    Tg

Topic Closed

This topic has been closed to new replies.

About this Topic