Viewing 15 replies - 1 through 15 (of 36 total)
  • Woohoo. This is just what I wanted. You’re the man Alex!!

    Nice job Alex, you continue to impress everyone. Have you found that this works better than the javascript version offered say, on A List Apart’s site? That’s the one I use, and I like the fact that I don’t have to reload between style switches and the other sheets are offered as alternates for browsers that support it. However, it tends to get buggy sometimes, and I’ve been looking for a better (read: PHP) alternative, this might be it.
    Nice styles too!
    uplink

    Thread Starter Alex King

    (@alexkingorg)

    Yep – time to upgrade. 🙂

    Thread Starter Alex King

    (@alexkingorg)

    Fixed a bug: Some of the links weren’t “clean permalink” aware in the first release.

    Here’s a site for templates and Word Press is one of the choices! Template Generator. It’s the cutest site! 🙂

    That site is pretty cool… I’m not sure if they’ve updated the WordPress functionality to work with the 1.0+ versions of WordPress (the site has been around for quite a while now)… But it’s worth a shot!

    I never could get it to generate the right files.

    Cena, I just pull apart the template and make it a little more friendly. I’m just looking at the .CSS anyhow as I love how my templates are. 🙂

    Ok I’ve visited some of the other sites using this script and I hope I got this right
    1. The ?php wp_style_switcher(); ? include only calls WP-Default, correct?
    2. to switch to the other templates I just need to add a link to the folder like so
    http://mysite.com/index.php?wpstyle=mystyle. Is this right?
    Please let me know if I’m doing this the correct way, as I took it as once I added a style folder to the wp-style directory a link for the style would be outputted by the style_switcher. I hope this makes since.

    HAHA ok I think I’ve got it. I was renaming my style sheets, but all the stylesheets must remain as style.css in order to show. I hopes this helps another newb. Peace

    Thread Starter Alex King

    (@alexkingorg)

    The wp_style_switcher() function puts a list (of the styles you have installed) on your page so people can switch between them.
    Hopefully with the CSS Style Competition, there will be a nice collection of styles available very soon.

    Is there a version of this to say point the site to look for required files in a different folder?
    For example, I made my layout in dreamweaver, and use a bunch of PHP includes for different parts of the site.
    Is there a way something like this could be modified to look for index.php, wp-comments.php etc etc in a different folder to skin the site that way?

    You can skin your site the traditional way. I have a tutorial here. 🙂

    mtanner wrote: “HAHA ok I think I’ve got it. I was renaming my style sheets, but all the stylesheets must remain as style.css in order to show. I hopes this helps another newb. Peace”
    Thank you! I was wondering what I was doing wrong! 🙂

    I’ve written an addition that add the title attribute to the style tag where wp_style_switcher is called. This is especially handy for Mozilla where you can now use the CSS-changer button in the bottom left corner of the status bar.
    Add this to the bottom of your wp-style-switcher.php:

    function wp_style_name($default = "wp-default") {
    if (!empty($_COOKIE["wpstyle"])) {
    $style = $_COOKIE["wpstyle"];
    }
    else {
    $style = $default;
    }
    echo $style;
    }

    and change your style tag to this:

    <style type="text/css" media="screen" title="<?php wp_style_name(); ?>">
    @import url( <?php wp_stylesheet(); ?> );
    </style>

    Script can be seen in action at my site.

Viewing 15 replies - 1 through 15 (of 36 total)
  • The topic ‘CSS Style Switcher’ is closed to new replies.