K2 Style Switcher

Due to ongoing personal issues, I have not been able to give this plugin the time and energy it needs. It has received no significant development in over a year. I have been unable to respond to user comments in a timely fashion. And there have been several excellent suggestions for development that I simply have not had the time and energy to work on.

All facts that have been quite disturbing to me, but with no viable alternatives, I had no choice but to continue on and hope to get back to development “someday”. Unfortunately, “someday” has a way of never coming.

Hugh Johnson of The Curious Frog has generously offered to take over as lead developer on the project. He contacted me after modifying the plugin to work with WPMU (WordPress Multi-User). You can find the new permanent home for the plugin on his site, where you can post any comments and questions you have. Development has already begun on version 1.0 of the plugin, and the development roadmap is in production.

Please visit the plugin’s new home at The Curious Frog.

Comments for this post are now closed.

14 Responses to “K2 Style Switcher”


  1. 1 Ivan

    Could you make the plugin work without the use of java-script? Just on pure php

  2. 2 Kimya Hasira

    The plugin works both with and without javascript.

    If you use the list option, javascript will be added. If you use the dropdown menu option, there’s no javascript in that option at all. It’s pure php.

    The plugin is written not to add the javascript unless you do use the list option, so as long as you avoid that option, you should be fine.

  3. 3 Matt

    This is exactly what I was looking for but 2 problems:

    1) I’m using the “3 Column K2″ modded theme and I think that’s preventing the styleswitcher list/menu from displaying in my sidebar. Is there a way I could implement this using the “Sidebar modules” though a php or html module?

    2) This builds off the first but ideally I’d like to be able to switch styles using clickable graphics in the header. I’d settle for a way to just put clickable graphics in the sidebar but that would first require a fix for problem 1

    Thanks so much for the plugin! I don’t mean to be a pain with these specific requests but I’m pretty capable with php so if you can just put me on the right path…

  4. 4 Kimya Hasira

    Hello Matt :)

    No problem at all. Really. I’m glad to see someone with the 3 Column K2 using it. Gives me a chance to do some beta testing, and perhaps tweaking if necessary.

    1. I myself use the plugin with Sidebar Modules. In fact, if you have the Sidebar Modules plugin installed, then the Style Switcher won’t display if you attempt to edit your sidebar template manually. I know this from testing on my own sites. I put the code in a new PHP module instead, and voila! Style Switcher goodness.

    2. “Clickable graphics in the header”… How very interesting. I believe I know of a way it can be done, but it will take a bit of tweaking. I’ll have to add a third display option first, then have it output… What? Please let me know exactly what functionality you’re looking for, and I’ll see what I can do.

    I already know that where it’s placed will probably have to be controlled by CSS. Of course, since the code won’t necessarily be in the sidebar, maybe not. Won’t be able to tell until testing. Speaking of which, I assume you’re volunteering for testing… :D

  5. 5 Matt

    So did you just slap the whole of the code into a php module or is there a specific section you cut out? I tried a couple of different areas from the plug-in but I haven’t tried just sticking it in wholesale.

    As for the graphic, I’m essentially thinking of something like the color switcher under the header at ArsTechnica (www.arstechnica.com)

    I’m going to be using the switcher to switch between a black-text-on-white-background style to a white-text-on-black style like on Ars (people bitch about my white-on-black default so I’m going to offer an alternative). So, being that I’ll only be switching back and forth between 2 styles, it may be simpler than a multi-style situation.

  6. 6 Kimya Hasira

    No, you call the Style Switcher the usual way. Make a new PHP module, then put this in the “Module’s code:” area:
    <?php k2ss_sidebar(); ?>

    That’s it. No special configuration required. If that’s not working for you, please let me know, as something is seriously wrong. Although to the best of my knowledge, the 3K2 theme just relies heavily on the Sidebar Modules plugin, so it shouldn’t be experiencing any conflicts.

    So you’d like to have a *specific* graphic for each style? Wow. O_o

    That’s going to take a bit of tweaking, but it’s fairly easy to do. Just somewhat time-consuming. Give me a few days?

  7. 7 Matt

    Hey, sure thing man. If you can make it happen I’d be the first to sing your praises.

  8. 8 Matt

    If it helps out, I have the staging site up and running here:

    http://www.mnpublius.com/Publius4

    You can see the switcher as it exists now in the sidebar

  9. 9 Kimya Hasira

    I’ve tried the switcher, it seems to be working well. You seem to have some other javascript errors going on though, as I get 2 “404″ popups every time I load your page. Just an FYI, as I don’t think its the Style Switcher. I hadn’t clicked on either link when I got the error.

    As far as the graphical option goes, I should have a beta for you to test in a couple of days. I’ll email it directly to you when it’s ready, as I won’t release it until I’m sure it’s working.

  10. 10 Matt

    Yeah, I’m seeing those 404s now myself and it’s clearly not the switcher–the switcher is working perfectly. As for the graphical option, I’ll be looking forward to it!

  11. 11 Bundy

    Hello!
    I want my visitors, to change the k2 scheme, if they want. Is it possible, to store the selected options in a cookie, and when they come back, they see their style? I also want to localize this script into Hungarian, because it is very useful. Please provide me some info about, if it can use cookies, or how shoud I make it to remember visitors choice. Sorry for my language mistakes, thanks. Bundy

  12. 12 Jeff

    Hi there!
    I’m currently running WP 2.3 with K2.0 RC2. I tried it and it doesn’t detect my K2. Is this because of the new K2 versions or something? Can you advise me where to do the changes so it is compatible with K2.0 RC2 (Newest version)
    http://www.windstarfire.net
    Cheers, and happy WP’ing!

  13. 13 Kimya Hasira

    I’ve been AWOL for a bit, as I had *a lot* going on. I’m just now getting back into the swing of things, so a bit of patience is appreciated. Thanks :)
    So - about the newest WP and K2 versions…

    I have not yet tested the Style Switcher with WP 2.3 - or with the newest K2 version. I use Fantastico and have not yet been prompted to upgrade my WP. I suppose I could install both manually on some subdirectory and see what happens.

    Off the top of my head, I’d have to say all the new fangled K2 sidebar technology is interfering with the normal operation of the Switcher. Then again, could just be the new WP - which, as I’ve said, I haven’t taken for a test drive at all…

    In short, I need to do some testing. After I do some reading about exactly what these newest versions entail.

    The plugin is fairly simple though. Good solid PHP calls, nothing fancy. What’s probably happened is that either WP or K2 deprecated one of the hooks I’m using to call one or the other of them. More than likely K2, as I don’t call WP much. (I’ve noted the absence of the footer styling in recent K2 versions, for instance - although that shouldn’t really affect the Switcher much.)

    Once I find the old hook and replace it, everything should be up and running again. Shouldn’t take too long, but I’ll keep you posted :)
    @Bundy: (I sincerely apologize for this extremely late reply.) The Switcher was designed to do what you’re asking for out of the box - so I assume that the K2 version which started causing problems was released fairly close to when you posted this question.

    Of course, on my personal site I’m using K2 Beta Two svn - so maybe not. I’m also using WP 2.2 - actually looks like I upgraded on this site as well. So I guess we’re back to, it’s got to be the newest versions of everything causing the glitches.

    Let me see what I can do…

  14. 14 anne

    This plugin should still work with the K2 Sidebar Manager. Though you have to use external plugins like Exec-PHP and paste the snippet mentioned above to text widget.

    I’m not sure if anybody is still stuck so I hope this works for you as it did for me. Wonderful plugin!

  1. 1 K2 Style Switcher | The Curious Frog
Comments are currently closed.