
|
davediamondprovo rated 14 months ago- From the page: "/**
* Truncate the string if it is beyond a certain $length and append with an ellipses or custom text
* $length is the number of characters allowed before truncating
* $append is appended to the truncated string
*/
function your_theme_custom_truncate($string = ''...
|
|
2 Reviews
-
-
 deocanto rated 10 months ago- Very nice!
 davediamondprovo rated 14 months ago- From the page: "/**
* Truncate the string if it is beyond a certain $length and append with an ellipses or custom text
* $length is the number of characters allowed before truncating
* $append is appended to the truncated string
*/
function your_theme_custom_truncate($string = '', $length = 30, $append = '...') {
return strlen($string) > $length ? trim(substr($string, 0, $length)) . $append : $string;
}"
|