/ Published in: PHP
Add to your functions.php in the active template.
Remove commented text. Fat/Thin char detection still not implemented. I'll update it as soon as I get some time. If you come with it please let me know :)
Expand |
Embed | Plain Text
function pcsite_trim ($text, $maxwords, $allowtags = "") { // Strip tags //workingonthis-$thinchars = ereg_replace("[^fijlt]", "", $text); //workingonthis-$fatchars = ereg_replace("[^mw]", "", $text); //workingonthis-$modifier = 5.1 + ( (strlen($thinchars) / strlen($text)) - (strlen($fatchars) / strlen($text)) ); $modifier = 5.1; // average letters per word (in normal english it's 4.5, but in blogging and so it increases) // Array to text $text = "<p>".$text."...</p>"; return $text; }
You need to login to post a comment.
