Support » Plugin: Classic Text Widget » Missing widget_text class

  • Resolved Kramarz


    Cheers for the plugin.

    One improvement suggestion.

    Text widgets in WP get ‘widgets_text’ class added to them by default. And that is being used by various themes to style widget’s elements.

    Your widget is missing that class, so styling for widget elements is missing in many themes.

    Any chance in adding that class to the widget your plugin generates, please?

    So it should be this:

    class=”widget widget_text classic-textwidget”

    instead of only what we currently have in your widget:

    class=”widget classic-textwidget”



    For now I have added it myself by modifying line 20 in class-classic-wp-widget-text.php from:

    $widget_ops = array( 'classname' => 'classic-textwidget', 'description' => __('The classic text widget for arbitrary html or text.', 'classic-text-widget') );


    $widget_ops = array( 'classname' => 'widget_text classic-textwidget', 'description' => __('The classic text widget for arbitrary html or text.', 'classic-text-widget') );

    • This topic was modified 6 years, 5 months ago by Kramarz.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Christina


    We don’t want conflicts with a core plugin. It’s very simple to use the class classic-textwidget in your CSS. Keeping as is.

    Thread Starter Kramarz


    Not that simple, as it’s not my CSS, it’s theme css, so occasionally it could be problematic to replicate all the styling in child theme, especially for live websites.

    Anyway, I got it sorted for my needs as I mentioned in P.S.


    Plugin Contributor Christina


    Then you would add the class to the properties or create additional CSS, but using a reserved class from a core plugin coded in php in another plugin is a major no-no. A child theme is meant to be changed and the CSS is just icing.

    Thread Starter Kramarz


    Ok, never mind me, turns out the fix I done for myself is not enough anyway, as .textwidget class is also needed.

    Yup much work through child theme re-styling then needed.

    Still, thanks for the plugin as is.

    Plugin Contributor Christina


    I just wrote a filter to add a class without actually changing the plugin, so that when the plugin updates, your mods don’t go away.

    Until that is released, I suggest not using the widget classes and instead use a plugin called Widget Classes, then add a class to the widget, and style. It’s much easier to use class names that have semantic meaning.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Missing widget_text class’ is closed to new replies.