I want to rename "Widget" to something else

Like "Block" or something else.

please help me.


Per the user's comment below, she wants to change class="widget" to class="block" (or any arbitrary class name) in the rendered, sidebar Widget.

  • 2
    We need considerably more information, if we are to hope to help you here... Oct 25 '11 at 14:53
  • want to rename "class="widget" to class="Block" in sidebar
    – user8503
    Oct 25 '11 at 14:58

The classes assigned to rendered Widgets are specified by the argument array passed to the register_sidebar() call used to register the sidebar. e.g.:

    $args = array(
        'name'          => sprintf(__('Sidebar %d'), $i ),
        'id'            => 'sidebar-$i',
        'description'   => '',
        'before_widget' => '<li id="%1$s" class="widget %2$s">',
        'after_widget'  => '</li>',
        'before_title'  => '<h2 class="widgettitle">',
        'after_title'   => '</h2>' ); 

See the before_widget parameter:

'before_widget' => '<li id="%1$s" class="widget %2$s">'

...change it accordingly, e.g. to:

'before_widget' => '<li id="%1$s" class="block %2$s">'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.