Two-tone menu items

Hi @cannyboy:

Unless I misunderstand, I think what you need is to use 'the_title' filter.

If you simplly enter “Title 1 * Title2” into your title field, this code I’ve written for this hook should wrap your Title2 in a <span class="title2"> which will allow you to style it with CSS. You can put the following code into your theme’s functions.php file:

add_filter('the_title','yoursite_the_title');
function yoursite_the_title($title) {
  $titles = explode('*',$title);
  $title = trim($title[0]);
  if (isset($title[1])) 
    $title .= ' * <span class="title2">' . trim($title[1]) . '</span>';
  return $title;
}

Of course this will wrap your second title everywhere so you might have some places it does it that you don’t want it to do it which case you’ll need to figure out how to tell the function not run for only those cases.