Nov

02

WordPress Style First Word of Widget Titles

Posted by CodeMunkyX

Similar to my last post about adding html to the first word of titles, this is the code to do the same with widget titles. Just copy the code below into your functions.php file.

// Adds <span></span> around the first word of Widget titles
function arixWP_widget_title($title) {
$title = preg_replace('/(^[A-z0-9_]+)\s/i', '<span>$1</span> ', $title);
return $title;
}
add_filter('widget_title', 'arixWP_widget_title');

Tags: , ,

Socialize

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

featured wordpress themes