I love WooThemes. Great themes, great support, great people. One thing I love about their themes is just how functional they are. One of the really cool widgets available in a WooThemes theme is the WooTabs widget. This is a nifty little widget that will display a list of your latest and most popular posts… along with recent comments and post tags.
It’s a cool little widget with a number of good options.
One of the things I’ve wanted to do with that widget, however, was to have it display only the popular and latest posts from a certain category (something, the widget currently doesn’t do).
So, I decided to dig in the code and hack the widget to add this functionality.
I’ve successfully added it and tested it on a couple sites and I want to make it available to you, as well.
Here’s how it works:
- When you place the WooTabs widget in your sidebar, you’ll notice a new options box called “Categories to Include”.
- You enter a comma-separated list of the category IDs you’d like the widget to use. You can also you negative categories (e.g -34) to exclude certain categories.
- Save settings and you’re all set.
It’s pretty simple, but also pretty handy.
To install this hack…
- Download and extract the zip file below.
- The zip file contains two files. A “theme-functions.php” file and “widget-woo-tabs.php” file.
- Upload the “theme-functions.php” file to “/themes/<yourwootheme>/includes/” and upload the “widget-woo-tabs.php” file to “/themes/<yourwootheme>/includes/widgets/”.
Now, you’re all set.
Keep in mind, this will overwrite the files that already exist there. So, when asked by your FTP program, YES, you do want to overwrite these files. The only thing altered in these files is what is necessary to add the category functionality.
I’m sure, at some point, WooThemes will add in this functionality on their; however, for now, this will get you going.
















