Php function
function news_excerpt($full_text, $letter_count = 50){
$full_text = trim($full_text);
$full_text = strip_tags($full_text);
$full_text = strip_shortcodes($full_text);
$full_text = mb_substr($full_text, 0, $letter_count);
$full_text = $full_text."...";
return $full_text;
}
Html
<?php echo news_excerpt(get_the_content(),100);?>
No comments:
Post a Comment