I have created the code below for one of my widget sections. Currently I am able to manipulate the title bar with (h3.home-widget-header) which is good. But obviously it will be for all widgets in that section. There is 1 or two widgets that I need to style the positioning of the title bar slightly different. My question is - is this possible and how would I go about writing a unique class so I can manipulate each widget in that section individually.

Thanks ahead of time!

  • Mike

if ( function_exists('register_sidebar') ) {


    'name' => 'Homepage Widget Area',

    'before_widget' => '<li class="home-widget">',

    'after_widget' => '</li>',

    'before_title' => '<span class="home-widget-header"><h3 class="home-widget-header">',

    'after_title' => '</h3></span>',



1 Answer 1


please study the RELATED links here in the right sidebar.


refer to this line:

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

%1$s outputs an id specific to the widget type; %2$s outputs a widget specific class including an unique number.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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