Title: Customizing widget class names
Last modified: August 19, 2016

---

# Customizing widget class names

 *  [dfunkydog](https://wordpress.org/support/users/dfunkydog/)
 * (@dfunkydog)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/customizing-widget-class-names/)
 * I have a widgetized footer and I want to be able to style every third widget 
   in the footer differently. I know I can use :nth-child(3n) in css but that won’t
   work in older browsers. Currently I’m using jquery to solve this.
 * However I am after a non-javascript solution, specifically getting the widgets
   to output class names based on their position, widget-1, widget-2 etc.
 * Is this possible?

Viewing 1 replies (of 1 total)

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/customizing-widget-class-names/#post-1300429)
 *     ```
       $s = wp_get_sidebars_widgets();
           print_r($s);
       ```
   
 * That should give you an array of sidebars and their widgets. I haven’t checked
   carefully but it looks like the widgets are in order so you should be able to
   parse that to find you widget positions.
 *     ```
       print_r($args);
       ```
   
 * … will tell you which sidebar your widget is in, if you need that.

Viewing 1 replies (of 1 total)

The topic ‘Customizing widget class names’ is closed to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [widgets](https://wordpress.org/support/topic-tag/widgets/)

 * 1 reply
 * 2 participants
 * Last reply from: [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * Last activity: [16 years, 4 months ago](https://wordpress.org/support/topic/customizing-widget-class-names/#post-1300429)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
