Type to search.

#532 by installs

Widget CSS Classes

by Jory HogeveenVersion 1.5.4.1

Add custom classes and ids plus first, last, even, odd, and numbered classes to your widgets.

Active installs
80,000+
#532 of 1,000
Downloads, all time
1.1M
1,138,917
Downloads, 30 days
2.3K
601 in the last 7
Rating
4.9 / 5
74 reviews
Last updated
24 months ago
Nov 12, 2024
Version
1.5.4.1
22 releases

Upkeep and compatibility

Last updatedNovember 12, 2024Not updated for over a year
Tested up toWordPress 6.7.11Older than WordPress 7.1.4, the current release
Needs WordPress3.3 or newer
Needs PHP5.2.4 or newer
First publishedJuly 16, 2012
Support, last two months1 of 1 threads resolved (100%)

Reviews

4.9 / 5 from 74 reviews

Reviews by star rating
5 stars70
4 stars3
3 stars0
2 stars1
1 star0

Downloads, last 30 days

Low 32 a dayHigh 151 a day

What the author says it does

Widget CSS Classes gives you the ability to add custom classes and ids to your WordPress widgets

Please note that this plugin doesn’t enable you to enter custom CSS. You’ll need to edit your theme’s style.css or add another

plugin that allows you to input custom CSS.

This plugin also adds additional classes to widgets to help you style them easier:

  • widget-first: added to the first widget in a sidebar
  • widget-last: added to the last widget in a sidebar
  • widget-odd: added to odd numbered widgets in a sidebar
  • widget-even: added to even numbered widgets in a sidebar
  • widget-#: added to every widget, such as widget-1, widget-2

Features

  • Adds a text field to a widget for defining a class
  • You can specify multiple classes by putting a space between them
  • Optionally adds checkboxes with predefined classes
  • Optionally adds a text field to add an id to a widget
  • Adds first and last classes to the first and last widget instances in a sidebar
  • Adds even/odd classes to widgets
  • Adds number classes to widgets
  • Fully translatable
  • Multi-site compatible
  • Compatible with Widget Logic, Widget Context, and WP Page Widget plugins
  • Has filters and hooks for customizing output including class names

Plugin Website

Credits

  • Adding Custom CSS Classes to WordPress Widgets
  • Add .first & .last CSS Class Automatically To WordPress Widgets

The opening of the plugin's own description. The full text, installation notes and changelog are on its WordPress.org page.

Questions the author answers

Why aren’t the classes showing up in my widget?

You need to make sure you have an HTML element defined for before_widget and after_widget in your active theme’s register_sidebar functions,

usually located in your theme’s functions.php (/wp-content/themes/yourtheme/functions.php).

This HTML element must have class and id attributes. This plugin will not work if before_widget and after_widget are blank.

Example:

register_sidebar( array(

'name' => 'Sidebar',

How do I add the CSS for my custom class?

There are two ways:

  • Edit your theme’s style.css file (usually located in /wp-content/themes/yourtheme/).
  • Use a plugin such as Simple Custom CSS.
How I export the Settings?

You can export the Settings from Settings > Widget CSS Classes > Import/Export.

What should I do if I find a bug?

Please file a bug report on GitHub.

Latest changelog entry

1.5.4.1

  • Tested with WP 5.5.
  • Update plugin owner.

Screenshots

From WordPress.org.

Tagged

Plugins that share its tags

#62 by installs

One Click Demo Import

by Syed Balkhi

Import your demo content, widgets and theme settings with one click. Theme authors! Enable simple theme demo import for your users.

Installs
1+ million
Rating
4.3 (79)
Updated
6 months ago

#130 by installs

Ocean Extra

by oceanwp

The ultimate companion for OceanWP. Adds local Google Fonts, mega menus, site templates, and per-page settings for total design authority.

Installs
400,000+
Rating
3.3 (67)
Updated
18 days ago

#146 by installs

SiteOrigin Widgets Bundle

by Greg - SiteOrigin

Essential elements for modern websites. Add buttons, sliders, heroes, maps, images, carousels, features, icons, more. Create dynamic pages easily.

Installs
400,000+
Rating
4.9 (134)
Updated
1 day ago

#163 by installs

Blocksy Companion

by Creative Themes

The official companion plugin for Blocksy theme, packed with starter sites, extra features, and integrations.

Installs
300,000+
Rating
4.7 (93)
Updated
2 days ago

Where this page's numbers come from

Read from the WordPress.org plugin API on , when WordPress 7.1.4 was the current release. WordPress.org rounds active installs into buckets. These are the directory's figures, not my verdict, and I haven't tested this plugin. The author takes donations at their donate page.