Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change HTML-code of widgets in WordPress

How to change HTML-code of widgets? I tried to make some changes in sidebar.php but no result.

I'll be very grateful for any help.

like image 239
Mirgorod Avatar asked Feb 27 '11 19:02

Mirgorod


1 Answers

It's defined in your functions.php file. You can easily change it by passing in the correct options

if (function_exists('register_sidebar')) {
        $opts   = array(
        'name'          =>  'IndexWidgets',
        'before_widget' =>  '<div id="%1$s2" class="home_box %2$s">',
        'after_widget'  =>  '</div></div>',
        'before_title'  =>  '<h2>',
        'after_title'   =>  '</h2><div class="home_box_body">'
    );
    register_sidebar($opts);
}

This is the Wordpress codex link for reference : http://codex.wordpress.org/Function_Reference/register_sidebar

like image 106
JohnP Avatar answered Nov 13 '22 21:11

JohnP