Support » Theme: Responsive » [Theme: Responsive] Request: please add widget area name to the class or id

  • Resolved maxemil


    Could you please add the widgets position to the classes in the sidebar-x.php files..

    like this..

    <?php if (!dynamic_sidebar('home-widget-3')) : ?>
    <div class="widget-wrapper home-widget-3">

    or even

    <?php if (!dynamic_sidebar('home-widget-3')) : ?>
    <div class="widget-wrapper" id="home-widget-3">


    It will make it easier to identify the areas for CSS styling (offer 1, offer 2, offer 3…)

    PS: that mean also to remove the class from the general widget area around home widgets..

    <div id="widgets" class="home-widgets">

    – maby this is a fix and not a request 🙂

    BTW: I registered to your forum, but I cannot post to it becourse I get
    “Pun stop bots question” using both Chrome and Firefox

    Best Regards \ME

Viewing 6 replies - 1 through 6 (of 6 total)
  • Emil Uzelac


    Theme Review Admin

    They’re actually. Don’t look what’s in the sidebar, see the function.php instead and you will see:

    'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
    'after_widget' => '</div>'



    Not really…

                'name' => __('Home Widget 1', 'responsive'),
                'description' => __('Area Six - sidebar-home.php', 'responsive'),
                'id' => 'home-widget-1',
                'before_title' => '<div id="widget-title-one" class="widget-title-home"><h3>',
                'after_title' => '</h3></div>',
                'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',
                'after_widget' => '</div>'

    makes it show the widget type like:

    <div id="text-3" class="widget-wrapper widget_text"><widget content here></div>

    What I request is that the widget AREA that you specify is used as the id/class instead.

    'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s widget-home-1">'

    Becourse id=”text-3″ or class=”widget_text” is not specifiv to the position/area on the website – but to the functionality of the chosen widget – I would have to make a css specification to all thinkable widgets, instead of on the area..

    We want the same thing, Im just doing it in another way.. 🙂


    what stops you to change these:

    'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s">',


    'before_widget' => '<div id="%1$s" class="widget-wrapper %2$s widget-home-1">',

    or however this needs to be done in a child theme.

    Emil Uzelac


    Theme Review Admin

    When you look at the source, this actually comes down to individual elements e.g.


    Also home widgets do have an extra class built in, it’s called home-widgets

    It’s similar but not exactly the same as yours 🙂

    P.S. @alchymyth thank you for being around, much appreciated 🙂

    @alchymyth nothing prevents me from using my own example.

    If anyone needs to do what I do:

    add_filter( 'dynamic_sidebar_params', 'add_my_widget_position_class');
    function add_my_widget_position_class($params)
      $widget_class = $params[0]['id'].' '; // make sure you leave a space at the end
      $widget_class = 'class="'.$widget_class;
      $params[0]['before_widget'] = str_replace('class="',$widget_class,$params[0]['before_widget']);
     return $params;


    Emil Uzelac


    Theme Review Admin

    Good stuff thanks!


Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Theme: Responsive] Request: please add widget area name to the class or id’ is closed to new replies.