<?php
function chlimit($len, $terminating_string) {
global $post;
$text=get_the_content();
$text=strip_tags($text);
$text=substr($text,0,$len). $terminating_string;
return wpautop($text, 0);
}
?>
————————-
<?php echo chlimit(500, ‘….’); ?>

Advertisements