<txp:title /> /* * Retrieve the first 20 words from the plain text 'Excerpt' column from the 'textpattern' table. */ $words = safe_field('Excerpt', 'textpattern', 'ID = "'.article_id(array()).'" AND Status = "4"'); echo preg_replace('/((\w+\W*){20}(\w+))(.*)/', '${1}', $words);