Name Update Time
Netflix September 14, 2024 10:30 am
Disney+ September 10, 2024 10:09 am
Max September 14, 2024 10:20 am
ChatGPT 4 September 14, 2024 2:26 pm
Spotify September 14, 2024 2:08 pm
Prime Video September 14, 2024 2:22 pm
Codecademy September 14, 2024 2:13 pm
Grammarly September 14, 2024 4:45 pm
Canva Pro September 12, 2024 2:24 pm
Udemy Premium Cookies September 2, 2024 2:53 pm

Switch to the directory where the theme is located, open functions.php, and add the following code:

function jackyexcerpt($max_char = 200, $more_text = ‘…’, $limit_type = ‘content’) {

if ($limit_type == ‘title’) { $text = get_the_title(); }
else { $text = get_the_content(); }
$text = apply_filters(‘the_content’, $text);
$text = strip_tags(str_replace(‘]]>’, ‘]]>’, $text));
$text = trim($text);
if (strlen($text) > $max_char) {
$text = substr($text, 0, $max_char+1);
$text = utf8_conver($text);
$text = str_replace(array(“\r”, “\n”), ‘ ‘, $text);
$text .= $more_text;
if ($limit_type == ‘content’){
$text = “<p>”.$text.”</p>”;
$text .= “<div class=’read-more-wrapper’><a href='”.get_permalink().”‘ title=’read more’ rel=’nofollow’><span>Read More</span></a></div>”;
}
echo $text;
} else {
if ($limit_type == ‘content’){$text = “<p>”.$text.”</p>”;}
echo $text;
}
}

function utf8_conver($str) {
$len = strlen($str);
for ($i=strlen($str)-1; $i>=0; $i-=1){
$hex .= ‘ ‘.ord($str[$i]);
$ch = ord($str[$i]);
if (($ch & 128)==0) return(substr($str,0,$i));
if (($ch & 192)==192) return(substr($str,0,$i));
}
return($str.$hex);
}

Just use the following code to call the place where you need to display the summary:

<?php jackyexcerpt(200);?>