I’m trying to make my widget titles two-colored; the first word white and the second one yellow. I have no idea how I can insert a span before the second word of every widget title so that I can put a color to the span.
Leave a Reply
You must be logged in to post a comment.
If it is a text widget, it supports HTML tags (like
span
). You can usespan
and other tags in the heading of that widget. Just declare thespan
CSS of that heading tag in your stylesheet/CSS file.For just the page title, edit page.php and replace the_title(); with:
or for generally all titles (this will add the span around the first word in any title, such as post titles, page titles, and the_title is also used for instance in page lists) –
add something like this to functions.php of your theme: