Category Replacement Widget

I wanted a bit more flexibility with the Category widget than the default one from AutoMattic provided, so I separated it out and changed the code. The itch I needed to scratch first was whether or not to show empty categories– categories that do not have any public posts.

Given that I have private posts over on my writing blog, not being able to see the categories was a pain. (I do need to find a way to hack the code so it’ll count private entries when logged in, but that’s a separate issue.)

I intend on putting it together so that you’ll be able to tweak more values… but for now, it’s just adding the toggle for empty categories.

Control Panel:

Control panel

Download here:

Older versions:

29 Responses to Category Replacement Widget

  1. K says:

    Thanks for this widget – please, is there anyway you could develop a foldable category/links widget? One of the problems I have is putting a foldable category series of links into my wordpress 2.0 theme.

  2. stormerider says:

    Thanks for this widget – please, is there anyway you could develop a foldable category/links widget? One of the problems I have is putting a foldable category series of links into my wordpress 2.0 theme.

    Not sure what you mean by foldable… send me an example and I’ll try to work on it?

  3. Rk says:

    Nice work. If you are taking suggestions from general public,
    I would like to see a way to select what appears on main page. (There are some plugins available..but highly unpredictable).

  4. stormerider says:

    I would like to see a way to select what appears on main page.

    A little more information on what you mean and I’ll certainly look into it.

  5. jason says:

    Really great widget, much simpler (and it works how i want it) than king-categories. One thing I’d like to see is an option for changing the order, right now it’s alphabetical, but if you could order by ID that would be fine

  6. stormerider says:

    Really great widget, much simpler (and it works how i want it) than king-categories. One thing I’d like to see is an option for changing the order, right now it’s alphabetical, but if you could order by ID that would be fine

    Added in version 0.2… allows you to toggle between sorting by ID and by name (defaulting to name as the previous version did).

  7. krista says:

    I installed this plug in (very excitedly, thank you for all your work) and it looked great on my site. Problem was though, when I clicked on the categories I got “file not found” pages, so I had to deactivate the plug in. Any ideas why it wouldn’t fetch the category information for me?

  8. stormerider says:

    I installed this plug in (very excitedly, thank you for all your work) and it looked great on my site. Problem was though, when I clicked on the categories I got “file not found” pages, so I had to deactivate the plug in. Any ideas why it wouldn’t fetch the category information for me?

    Looking at your site, you use the default permalinks setting “/?cat=13″, where the plugin is set for “/category/art-and-craft/” style.

    I’ll look into finding how to check the permalink settings and alter the style for version 0.5. Thanks for catching this!

  9. blog400 says:

    Thank you so much. Your widget is stable and functions well //!/

  10. ttancm says:

    This is a really nice widget and it does more or less everything I want it to. Just 1 problem and a couple of requests/suggestions.

    The problem first I suppose. If the display style is set to Dropdown and there are long catergory (or subcategory) names the names get cut off IE 6. Firefox expands the dropbox to display the names, but IE doesn’t. I use firefox but unfortunately IE still has 80-90% of the browser market so if possible it would be nice to have it work the same way in IE. I have no clue how to go about doing that though =)

    And suggestions/requests,

    The first, if it is possible will (for me at least) actually render the above problem moot. As K requested above foldable lists would be nice. By foldable I mean that while using the list display style you could have it show only parent categories and then click on the parent category (or a little + sysmbol/icon next to the category) to expand it and display the children categories. There is actually a plugin for foldable categories available (http://www.webspaceworks.com/resources/cat/wp-plugins/31/ if you’re interested) but the way it works is it refreshes the page and displays only the children of the currently selected parent category. If possible I would like all the categories to be viewable from anywhere on the site but also be able to fold them up to avoid clutter, and fold them up without having to reload the page.

    I imagine again that this might cause problems with sub categories and long category names pushing content to the side or being cut off, or wrapped (which is I believe the default behavior, but looks terrible). It might be possible to make it so that sub-categories are a different color rather than indented etc. (take a peak at this menu and click on the “click here to expand” bit to get a rough idea of what I am talking about http://www5.ocn.ne.jp/~okay/transassist/).

    Sounds like a monster of a request I think though. If the dropdown worked well in IE as well I wouldn’t need the collapable/foldable list feature but (second/alternative request/suggestion) the ability to change the style (colors, transparency etc.) of the dropdown list would also be nice if possible.

    Anyway, all of the above is just a wishlist of sorts, if any of it is possible it would be beautiful, but even if it doesn’t, other than the problem in IE your plugin works better then pretty much everything else out there (I’ve tried everything I could find for managing the categories), so thanks for the time and effort it took to create it!

    You have good taste in themes btw ;)

  11. Simon says:

    This plugin doesn’t work for other languages than Englisch. I have a German blog where when I actvated your plugin i suddenly had 2 overlapping Categories widgets. One named Categories and the other Kategorien (the German word). They both didn’t work properly.
    Do you have any suggestions on how to fix this problem?

  12. stormerider says:

    This plugin doesn’t work for other languages than Englisch. I have a German blog where when I actvated your plugin i suddenly had 2 overlapping Categories widgets. One named Categories and the other Kategorien (the German word). They both didn’t work properly.
    Do you have any suggestions on how to fix this problem?

    I have not tried any widgets with localization support. I’m curious, where did you see these widgets? On your site or in the Presentation page that lets you control the widget layouts?

  13. stormerider says:

    ttancm:

    I really haven’t had a chance to look into this. At first blush, I believe that this is something that can likely be handled via CSS rather than code, as I mentioned in the Drop-down Links comments.

    I will look at designing some foldable widgets when I have time, assuming someone else hasn’t beaten me to the punch– which is likely given how out of touch I’ve been lately.

    As for taste in themes, I prefer dark themes because I am prone to migraines. It gives a whole new meaning to hating websites with white backgrounds… (such as Google *sigh*).

  14. Xantor says:

    I have the same problem as simon, i´m coding a new blog in spanish, every time i insert your widget i get the same widget for my language added to the widget panel after saving, that is if i insert your categories widget after saving it adds the categorias widget under your widget (this happen with your link widget too) and of course it shows in the blog too. Please let me know if you plan to fix this in the near future, i really like your widgets they are excellent.

  15. Rob says:

    One note about the newest version. For a very few of us, the “silently fail” feature is bad if we don’t use the AutoMattic Widgets. I use Sidebar Modules (http://nybblelabs.org.uk/projects/sidebar-modules/), which is a MUCH better Widget manager. Only caveat is that for it to work, the AutoMattic Widgets plugin has to be disabled.

  16. Avi Alkalay says:

    Can you improve it to show per-category RSS icon ?
    So it will look like the category list on my blog.

    This is currently an option of the wp_list_cats() wordpress function, and I’m using it this way in my sidebar:

  17. Avi Alkalay says:

    PHP code on my sidebar:

    $iconURL=get_bloginfo(‘stylesheet_url’);
    $pos=strrpos($iconURL,’/’);
    $iconURL=substr($iconURL,0,$pos);
    $format=sprintf(‘sort_column=name&optioncount=1&feed_image=%s/img/iconminifeed.png’,$iconURL);
    wp_list_cats($format);

  18. Lauren says:

    Thanks for this widget – please, is there anyway you could develop a foldable category/links widget? One of the problems I have is putting a foldable category series of links into my wordpress 2.0 theme.thanks in advance.

  19. Ken says:

    Installed v0.5, auttomatic widgets already installed and working with others. Activated it, but it does not appear on the Sidebar Widgets tab. It is in the correct location plugins/widgets (otherwise it wouldn’t appear on the activation menu).

    Any ideas?

  20. stormerider says:

    Installed v0.5, auttomatic widgets already installed and working with others. Activated it, but it does not appear on the Sidebar Widgets tab. It is in the correct location plugins/widgets (otherwise it wouldn’t appear on the activation menu).

    Any ideas?

    This replaces the normal Category widget. You won’t see any different name, just different options in the widget.

  21. Ken says:

    This replaces the normal Category widget. You won’t see any different name, just different options in the widget.

    I should have thought of that. It works great. Thanks again.

  22. madzzoni says:

    Hello! I have the same problem as simon/Xantor, i´m coding a new blog in danish, every time i insert your widget i get the same widget for my language added to the widget panel after saving, that is if i insert your categories widget after saving it adds the “Kategori” (da) widget under your widget and of course it shows in the blog too. Please let us know if you plan to fix this in the near future, i really like this widgets – thanks a lot!

    //madzzoni

  23. jochen says:

    Hi,
    sorry but where do i have to put or upload the widget?
    Thanks in advance Jochen

  24. Filly says:

    I seem to have some javascript issues going on, both with the archives and the categories dropdown widget. For instance : “document.forms.categoryform.category_list is null or not an object”. I’m a script newbie…Any thoughts? Thanks in advance.

  25. Pingback: WordPress Category Replacement Widget | Chilly Cool Blogger Resources

  26. Pingback: Wordpress plugins and hacks | Chilly Cool Blogger Resources

  27. Pingback: Quick look at WordPress issues in May: | Sam Devol

  28. Pingback: Wordpress plugins and hacks — Blog a Living

  29. Pingback: WordPress and Real Estate: What IS a Widget and Why Should You Care? | Angela Allen's Wicked Blog

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>