Created
May 30, 2014 15:31
-
-
Save krmd/92cf67de2123c7fd155a to your computer and use it in GitHub Desktop.
Insert Span in Widget Titles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag http://www.rickrduncan.com/wordpress/customize-wordpress-widget-titles | |
//* 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