Search code examples
wordpresstitle

wordpress widget title add span


I want to make the first word of a widget title a different color.

The widget code is this:

'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',

How can I had a span or a class in there so I can specify a different color in css?


Solution

  • I think you can't do this by just modifying widget code. If you really need first word highlighted, you may look for some javascript, jquery solution like here: First word selector