Excellent hack for K2 WordPress theme

One of the things I continue to find a bit tricky with WordPress and the customized K2 theme I have on this blog is tweaking the sidebar to include or exclude elements on certain pages.

Until now, I’ve been digging into the code in the sidebar PHP file and, through trial and error (and mostly luck), have ended up with results I’ve more or less been happy with. No dreaded parse error messages after my tweaking nor major display disasters.

All this has been fine for what displays on this blog’s home page. Where I’ve really run into difficulties is getting things to display or not display in the sidebar on other pages such as individual posts, archive pages, category pages, etc. For instance, I’ve never been able to get the RSS subscription options to display on any page other than the home page. This is all to do with the conditional statements in the PHP code where I’ve scratched my head over code like this –

<?php /* If this is a category archive */ } elseif (is_category()) { ?><?php printf( __(‘You are currently browsing the %1$s weblog archives for the \’%2$s\’ category.’), ‘<a href=”‘ . get_settings(‘siteurl’) .'”>’ . get_bloginfo(‘name’) . ‘</a>’, single_cat_title(”, false) ) ?>

But no more!

I’ve just installed a very nifty hack for K2 called Sidebar Modules written by Ben Sherratt. As described by Ben:

A hack for K2 to allow you to edit the contents of your sidebar. Drag and drop the modules, add your own custom content, decide what to display where, and other general funky stuff.

Funky indeed. It works a treat. It makes it so simple and easy to do exactly what you want to do, shielding you almost completely from any code editing. Reminds me of the ease of use with TypePad Typelists.

If you use K2 on your WordPress 2.x blog, this hack is indispensable. Ben, thanks for developing it.

Speaking of WordPress, version 2.0.2 has just been released. This is described as a security fix. Looks like quite a few bug fixes as well. I’m currently running 2.0.1 and do plan to upgrade. Soon.

[Edit] I’ve encountered a little problem so I’ve disabled Sidebar Modules for the moment. Help requested in the K2 Forum.

[Technorati: k2 theme, wordpress]

Neville Hobson

Social Strategist, Communicator, Writer, and Podcaster with a curiosity for tech and how people use it. Believer in an Internet for everyone. Early adopter (and leaver) and experimenter with social media. Occasional test pilot of shiny new objects. Avid tea drinker.

  1. neville

    [Note to self] Now let’s see. Upgraded to WP 2.0.2. Reinstalled Sidebar Modules again. Working fine. None of the log in issues I had yesterday after installing it nor the PHP error in the sidebar.

    This comment is primarily a test to see what happens after I post it. The problems I had yesterday started right after I posted a comment to a post. Let’s see what happens.

  2. neville

    Well it seems to be fine. So perhaps yesterday’s issues right after the comment were purely coincidental. And maybe those issues were to do with WP 2.0.1. Whatever the problem was, I’d really like to know.

    Let’s leave things as they are for the moment and see how the blog looks tomorrow morning. Hopefully nothing will have fallen over.

  3. More choice with WordPress widgets at NevilleHobson.com

    […] I’m especially interested in this as I’ve been experimenting with Sidebar Modules for K2, the theme that this blog uses on the WordPress platform/application you install on your own server (ie, not the hosted service). After some initial difficulties with it, I’ve now got the modules working fine. These modules work in a similar fashion to the new widgets, ie, Ajax/JavaScript based that you click-and-drag on your screen to position them where you want. (Modules, widgets – what’s in a name?) […]

  4. Lee

    Hi Neville,

    I tried to access the K2 site but I reckon it’s either crashed or been taken down for some reason. Do you have the same problem with it (is it just a problem at my end)?

    Also, your subscribe buttons are broken (posts, comments, podcasts)


    p.s. here’s hoping we can one day meet up — current business for me precludes any major water-hoping unless someone else is paying for it. But it would be fab to catch a coffee in a trattoria one day and stay for a week… (see http://leehopkins.net/2006/02/17/you-know-youve-made-it-when-you-are-tagged-for-the-four-things-meme/ )

  5. neville

    Lee, the K2 site is working fine. There are two new locations:

    K2 main site – http://getk2.com/
    K2 support forum – http://getk2.com/forum/

    The original site (shown in the footer on most K2-themed WP blogs) also still worked the last time I looked – http://binarybonsai.com/wordpress/k2/

    Re my RSS subscriptions, they’re working fine! Perhaps some little glitch at the moment you clicked on them, or something. Two of the three choices are to FeedBurner feeds and it’s very rare for them not to be working.

    Yes, meeting up would be great. We’ll find a way. If you’re planning to be at the IABC conference in Vancouver in June, that would be a good place!

  6. Drag and drop WordPress design at NevilleHobson.com

    […] Yet that still requires a considerable knowledge of CSS and PHP. A big help is the very cool Sidebar Modules for K2 I wrote about a few months ago, where you can simply drag-and-drop content elements in your sidebar without having to dive in to any code. It’s very easy to create your own modules to incorporate in your sidebar, as I’ve done here. A far better executed and more elegant solution than WordPress Sidebar Widgets. […]

Comments are closed.