• Hey,
    I have made a own theme, and I have a question about the register_sidebar() array in functions.php.

    my funtions.php looks like this:

    if ( function_exists(‘register_sidebar’) )
    register_sidebar(array(
    ‘before_widget’ => ‘<li id=”%1$s” class=”widget %2$s”>’,
    ‘after_widget’ => ‘<hr align=”left” width=”180″ color=”#c9c9c9″ size=”1″>’,
    ‘before_title’ => ‘<h2>’,
    ‘after_title’ => ‘</h2>’,
    ));

    Now after every widget I have displayed the “<hr>” tag, wich makes a line under every widget.
    It also makes a line under the last widget in the sidebar and I want to remove this line.

    So I only want the “<hr>” tag displayed between widgets, but not under the last widget in the sidebar.
    Can anyone help me?

    greetings

Viewing 1 replies (of 1 total)
  • Your ‘after_widget’ should be closing the <li> tag you opened in ‘before_widget’. You might also consider using a CSS <div> class in ‘after_widget’ as well to create, and style, a ‘hr’ like item to your taste.

    This will help with adding another CSS selector to identify the ‘li:last-child” to not show the line after the last widget.

    NB: These are suggestions only, you will have to adjust to your specific theme code.

Viewing 1 replies (of 1 total)

The topic ‘different design "after_widget"’ is closed to new replies.