I’ve done something similar with a custom output filter. The filter will append a <span> to the
first word in your heading. I hate having html tags where clients can see them!
When you call your pagetitle, add the filter like this:
[[*pagetitle:append_span]]
Then create a new snippet called
append_span, containing the following code:
<?php
$space_pos = strpos($input,' ');
$before = '<span style="color: red;">';
$after = '</span>';
if($space_pos)
{
$title = $before.$input;
$title = substr_replace($title,$after.' ',$space_pos+strlen($before),1);
}
else $title = $before.$input.$after;
return $title;
The solution was inspired by
this blog post, it seems to work well but no guarantees!