Created
June 6, 2014 17:41
-
-
Save rickalee/6e4e2927adfd66c7ca0b to your computer and use it in GitHub Desktop.
Filter Widget Title to add span on first word
This file contains 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
add_filter ( 'widget_title', 'kellyboudreau_add_span_widgets' ); | |
function kellyboudreau_add_span_widgets( $old_title ) { | |
$title = explode( " ", $old_title, 2 ); | |
if ( isset( $title[0] ) && isset( $title[1] ) ) { | |
$titleNew = "<span>$title[0]</span> $title[1]"; | |
} | |
else { | |
return; | |
} | |
return $titleNew; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment