Title: Widget Exceptions
Last modified: August 19, 2016

---

# Widget Exceptions

 *  [designcarter](https://wordpress.org/support/users/designcarter/)
 * (@designcarter)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/widget-exceptions/)
 * Have a strange need on a project I’m working with.
 * In the functions.php form I have special styling/enclosure for the sidebar widgets:
 * <?php
    if ( function_exists(‘register_sidebar’) ) register_sidebar(array( ‘before_widget’
   => ‘<div class=”myclass”>’, ‘after_widget’ => ‘</div>’, ‘before_title’ => ‘<h2
   class=”widgettitle”>’, ‘after_title’ => ‘</h2>’, )); ?>
 * So I have a Widget that I’m using on all pages in the same sidebar section. The
   difference is that I want to use a different enclosure around that specific widget.
   How can I do a conditional using the widget name, or what are my options?
 * Example that I’d change it to would be:
 * <?php
    if ( function_exists(‘register_sidebar’) ) register_sidebar(array( ‘before_widget’
   => ‘<div class=”myclass2″>’, ‘after_widget’ => ‘</div>’, ‘before_title’ => ‘<
   h2 class=”widgettitle”>’, ‘after_title’ => ‘</h2>’, )); ?>

Viewing 1 replies (of 1 total)

 *  [Valerie](https://wordpress.org/support/users/bunnygirl/)
 * (@bunnygirl)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/widget-exceptions/#post-852607)
 * I would like to know this, too!

Viewing 1 replies (of 1 total)

The topic ‘Widget Exceptions’ is closed to new replies.

## Tags

 * [conditional](https://wordpress.org/support/topic-tag/conditional/)
 * [customization](https://wordpress.org/support/topic-tag/customization/)
 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * 1 reply
 * 2 participants
 * Last reply from: [Valerie](https://wordpress.org/support/users/bunnygirl/)
 * Last activity: [17 years, 6 months ago](https://wordpress.org/support/topic/widget-exceptions/#post-852607)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
