Support » Plugin: Widget Logic » Widget Logic overwrites existing CSS classes

  • Hi,

    This is a useful plugin, but I feel that it has a fundamental problem.

    I have existing CSS classes on particular widgets, and this plugin automatically overwrites those classes. As such, whenever the plugin is active, if I have existing classes on my widgets, these disappear and are replaced by the widget-logic classes. As such, any particular styling I have gets removed, purely by the activation of the plugin.

    I don’t think that a plugin should operate in this way. If the plugin needs to do so, it should add classes, not replace existing classes.

    Other than that it is a useful plugin!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Note: I just wanted to elaborate on this a bit. I use the KC Widget Enhancements plugin to add custom classes to particular widgets. I have used it on several sites and it has worked well. Essentially all this plugin does, is it allows you to add a CSS class to a widget.

    What Widget Logic does, is while it uses the standard widget classes, when it is active. It overwrites my custom CSS class when active. As such, even though it uses the standard widget classes, it overwrites any classes I may have added.

    Plugin Contributor alanft


    ISTR coming across some clash with KC Widget Enhancements before – so it’s not that Widget Logic overwrites those CSS classes, it’s that WL clashes somehow with how KCWE adds them in the first place.

    I don’t know KCWE well enough to answer, sorry.

    Also, I don’t really understand the purpose of a plugin to add CSS classes to widgets, as by default WP will add classes and IDs enough to style as you please anyway. eg on the blog i admin, all widgets have the class “widget” and all text widgets also have the class “widget_text” too. In addition the ID of each text widget, eg “text-123456”, singles out a specific text widget, and so on for all widgets (not just text).

    Plugin Contributor alanft


    I’ve come across reference to this eg here

    where the KCWE developer says he will add code to detect how WL works. However I’ve resolved to get off my lazy coder behind at last and update the WL code if there is a more general problem that I’m causing with WL.


    Ok great! I suppose a clash between KC and WL is not a very common occurrence but it would be great to have any issues fixed between them.

    As for the use case of KC, I find it useful to be able to assign a utility class to various widgets sometimes so that I can attribute a set of styles to them. Sometimes the standard classes .widget, .widget-text, or the widget ID does not apply since I do not want the style attributed to all widgets, or necessarily all text widgets or even just one specific widget. Having the ability to assign a class to a selection of widgets is helpful since I then do not need to manually list each widget ID I want the styles attached to.

    Thank you for the feedback! Look forward to the update!

    Plugin Contributor alanft


    I’m not trying to be argumentative (or at least not provocatively so!), but

    “I then do not need to manually list each widget ID I want the styles attached to”

    but you do have to install and activate a plugin and then use it to manually add special classes to each widget. A manual list of IDs in the CSS seems simpler – lower overheads, less server processing etc.

    This is true. It is a little long winded to add all of that for a CSS class.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Widget Logic overwrites existing CSS classes’ is closed to new replies.