Theme Hocks
-
Hey,
I have the following code in my theme functions.php file…
add_filter('the_title', 'span_first_word'); function span_first_word($title) { $words = explode(' ', $title); $words[0] = '<span>'.$words[0].'</span>'; $title = implode(' ', $words); return $title; }
What that does is adds <span> around the first word of the title…
However it adds <span> in the admin list too… but displays the word..
EG: <span>About</span> UsIs there a way to only add <span> if its been displayed on the front of the website?
Dan
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Theme Hocks’ is closed to new replies.