KC Widget Enhancements

As I promised when I wrote the functions for adding custom classes for WordPress widgets, I’m now announcing the release of KC Widget Enhancements. This plugin provides the ability to set custom classes and ID for any widgets, not just the built-in ones, but also widgets that comes with installed plugins/themes.

This plugin is now hosted at WordPress plugin repo so you can install it directly from the admin dashboard.

Currently there are three components, but I designed this plugin to be extendable so it should be easy to add more in the future:

  • Custom widget ID
  • Custom widget classes
  • Enable shortcode on text widgets

If you have idea on how to enhance the widgets even more, please don’t hesitate to leave a comment below. I may add them in the next versions.

To get the most of this plugin, I highly suggest the use of KC Settings together with this plugin so you can enable/disable the components easily. Or if you prefer to do it the geeky way, please read FAQ section in the readme.txt file.

You can download this plugin from here or clone/fork it from github. I’ll update this post when it’s available on WordPress’ plugins repo.

As reported by Ed Nailor, the custom ID/classes won’t get printed if you’re using Widget Logic plugin, because it overrides the default callback for each widget.



  1. btw IMO it would be great, if you would make the fields in widget hidden by default – e.g. add an ‘Advanced’ link to Close | Delete at the widget bottom, and show the field after clicking the widget.

    Also it would be great, if you would create some own filters/actions, so if i would like some other behaviour, i could overwrite them, without need to create copy of your plugin. E.g. i would like to replace classes, not adding them. (or maybe some option, e.g. with “+” at the beggining of the field

    P.S.: great would be an integration of functionality of Widget Logic plugin. That would be completely Holy Grail of WP Widgets

  2. small error notice:

    Notice: Trying to get property of non-object in /var/www/vhosts/elektrickeauto.cz/httpdocs/wp-content/plugins/kc-widget-enhancements/custom_id_classes.php on line 58

    please always test your plugins with wp_debug enabled