Skip to content

Instantly share code, notes, and snippets.

@rickrduncan
Last active January 11, 2016 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rickrduncan/6087969 to your computer and use it in GitHub Desktop.
Save rickrduncan/6087969 to your computer and use it in GitHub Desktop.
Method 2: Customize WordPress widget title.Full tutorial: http://www.rvamedia.com/wordpress/customize-wordpress-widget-title
<?php
//* Do NOT include this comment or the opening php tag above
//* Insert SPAN tag into widgettitle
add_filter( 'dynamic_sidebar_params', 'b3m_wrap_widget_titles', 20 );
function b3m_wrap_widget_titles( array $params ) {
// $params will ordinarily be an array of 2 elements, we're only interested in the first element
$widget =& $params[0];
$widget['before_title'] = '<h4 class="widgettitle"><span class="sidebar-title">';
$widget['after_title'] = '</span></h4>';
return $params;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment