1. Home
  2. Docs
  3. Tips
  4. Changing Widget Title’s Heading Level

Changing Widget Title’s Heading Level

By default, Suki uses <h2> tag as the widget title of all widgets area like Sidebar, Footer Widgets, etc. This is a standard design as mentioned in WordPress’s headings guideline itself.

But in some cases, you might want to change the heading level of widget title to something other than <h2>, for example <h3> or <h4>. To do so, you need to use a Child Theme and add this snippet in your functions.php.

function suki_child_sidebar_params( $params ) {
	$params[0]['before_title'] = '<h3 class="widget-title h4">';
	$params[0]['after_title'] = '</h3>';

	return $params;
}
add_filter( 'dynamic_sidebar_params', 'suki_child_sidebar_params' );

The code snippet above will change all widget titles tag to <h3>, you can adjust the value as you see fit.

Was this article helpful to you? Yes No