Support » Themes and Templates » Customize output of sidebar widgets

  • Resolved artcoder

    (@artcoder)


    The dynamic sidebar widget of the default theme is generating …

    <ul>
    <li class="widget"></li>
    <li class="widget"></li>
    </ul>

    I need to change it to be …

    <ul>
    <li class="widget">
    <div class="widgettop"></div>
    <div class="widgetbody"></div>
    </li>
    <li class="widget">
    <div class="widgettop"></div>
    <div class="widgetbody"></div>
    </li>
    </ul>

    Where to alter the PHP code? I can not find in sidebar.php nor in the wp-include/widget.php.

    Is there way to overwrite wp-include/widget.php by putting a file in the custom theme directory?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Doodlebee

    (@doodlebee)

    Yes, in your functions.php file. Here’s two places to read up on it, and a sample bit of code:

    if (function_exists('register_sidebar'))
    {
        register_sidebar(array(
                  'before_widget' => '',
                  'after_widget' => '</div>',
                  'before_title' => '<h2>',
                  'after_title' => '</h2>'
         ));
    }

    what if you want to do this for just one widget within the dynamic sidebar, and not all? (f.e. tagcloud)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Customize output of sidebar widgets’ is closed to new replies.