• 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)
Viewing 1 replies (of 1 total)
  • The topic ‘Widget Exceptions’ is closed to new replies.