This is an example of register sidebar function from codex. My focus is on the before_title
argument. What i want is to add a class to the title(<h3>
). From my widget code or may be pass the class name from user input on widget area.
<?php $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' => '<h3>',
'after_title' => '</h3>' );
register_sidebar( $args );
?>
So, How do i add classes dynamically on widget header?