Again, the Swiss Army knife of template tag modifiers comes to the rescue: regex_replace.
Suppose you have set up a 'Bio' custom field for your Authors, so you can display more information about who they are. But on your main page you don't want to display all of this text, as it would quickly fill up the page. Here is what you can do to show just the first fifteen words:
<mt:authordatabio regex_replace="/^((.+?\s+){15}).*/gsi","\1">​
Note that the 'regex_replace' part will work on any tag, and you can vary the number of words by changing the number from '15' to anything you want.
Tweet
Leave a comment