Question: I use Wordpress and have a sidebar containing widgets, run by this code:

```
<div class="sidebar modern">
    <?php if ( is_active_sidebar( 'sidebar-modern' )) : ?>
        <ul>
            <?php dynamic_sidebar( 'sidebar-modern' ); ?>
        </ul>
    <?php else : ?>
    <?php endif; ?>
</div>

```

**What I do in wp-admin**

1. I add the archive widget
2. I set display as a select-list (dropdown) in widget options

What I need is to add a container HTML class to the select.

**I have tried these and failed:**

* CSS (because it's a design thing)
* Filter - widget\_archives\_dropdown\_args
* Filter - wp\_get\_archives filter

If it's possible to add a container class to all the widget inside (widget title not included), it would be fine by me.

Answer: 
Where you register the sidebar:

```
register_sidebar( array(
    'name'          =>  'Sidebar Modern',
    'id'            =>  'sidebar-modern',
    'before_widget' =>  '<div id="%1$s" class="%2$s widget clearfix">',
    'after_widget'  =>  '</div>',
    'before_title'  =>  '<h3 class="title">',
    'after_title'   =>  '</h3>'
) );

```

Modify it like so:

```
register_sidebar( array(
    'name'          =>  'Sidebar Modern',
    'id'            =>  'sidebar-modern',
    'before_widget' =>  '<div id="%1$s" class="%2$s widget clearfix">',
    'after_widget'  =>  '</div></div>',
    'before_title'  =>  '<h3 class="title">',
    'after_title'   =>  '</h3><div>'
) );

```

The key is the extra divs:

'after\_widget' => '**</div>**</div>'  

'after\_title' => '</h3>**<div>**'

**EDIT:**

As **Ionut Staicu** pointed out, you can just do it like so:

```
register_sidebar( array(
    'name'          =>  'Sidebar Modern',
    'id'            =>  'sidebar-modern',
    'before_widget' =>  '<div><div id="%1$s" class="%2$s widget clearfix">',
    'after_widget'  =>  '</div></div>',
    'before_title'  =>  '<h3 class="title">',
    'after_title'   =>  '</h3>'
) );

```
It's not possible right now without editing the Wordpress core.