Excellent hack for K2 WordPress theme

Posted on March 11, 2006 at 9:32 am (UK)
in: NevilleHobson.com, Weblog Tools

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: , ]

Related Posts with Thumbnails

Print This Post Print This Post

{ 2 trackbacks }

More choice with WordPress widgets at NevilleHobson.com
March 13, 2006 at 9:47
Drag and drop WordPress design at NevilleHobson.com
May 15, 2006 at 7:25

{ 4 comments }

1 neville March 12, 2006 at 19:43

[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 March 12, 2006 at 19:53

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 Lee March 15, 2006 at 1:06

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)

Cheers,
Lee

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/ )

4 neville March 15, 2006 at 10:09

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!

Comments on this entry are closed.

Previous post:

Next post: