Italicize a certain word across the whole site
-
Say I have a site for a company called BrandMaster and they want to have the second word in their brand name to always be italicized. Can I write something in my function.php to do this automatically?
With my rather meager PHP skills I was able to pull this off:
// Italicize Brandmaster add_filter('the_content', 'brandmaster', 99); function brandmaster( $content ) { return str_replace('Brandmaster', 'Brand<i>Master</i>', $content); }
This works but only for the_content. How can I extend this to sidebar content, titles etc.?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Italicize a certain word across the whole site’ is closed to new replies.