I published a free and open source book... "Contribute to Open Source: the right way"! You can download your copy for free :-D
This is very simple and you can do it in this way:
add_filter('dynamic_sidebar_params', 'yourtheme_change_widget_head'); function yourtheme_change_widget_head( $params ) { if ( $params[0]['id'] === 'footer-sidebar-2' ) { $params[0]['before_title'] = '<h4 class="widget-title">'; $params[0]['after_title'] = '</h4>'; } return $params; }
This filter allows you to check what is executed by dynamic_sidebar
as parameter.
So first of all you need to check what is the sidebar you want to alter and later the parameter that you want to change.
Where to put it? In the functions.php
of your child theme.