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);?>
Search
Popular on Blogar
Content Marketing-What is Content Marketing
- October 24th, 2023
- 1467 Views
Social Media Marketing-Social Media Marketing (SMM)
- October 24th, 2023
- 1754 Views
Pay-Per-Click-What is PPC
- October 24th, 2023
- 1313 Views
Social Media Marketing – 53 Resources For First Time Entrepreneurs
- October 24th, 2023
- 840 Views
Email Marketing-Advantages and disadvantages of email marketing
- October 24th, 2023
- 789 Views
Search Engine Optimization-Tell Google which pages you don’t want crawled
- October 24th, 2023
- 778 Views
Social Media Marketing – What is Pinterest?
- October 24th, 2023
- 757 Views
Email Marketing-Revenue Generation Email Marketing Campaigns
- October 24th, 2023
- 754 Views
Search Engine Optimization-Let Google see your page the same way a user does
- October 24th, 2023
- 751 Views
Search Engine Optimization-How to Leverage Link Blending and Stage 2 Link Building to Maximize Your Rankings
- October 24th, 2023
- 743 Views
Recent Post
Content Marketing-What is Content Marketing
- October 24th, 2023
- 1467 Views
Social Media Marketing-Social Media Marketing (SMM)
- October 24th, 2023
- 1754 Views
Pay-Per-Click-What is PPC
- October 24th, 2023
- 1313 Views
VMware cannot install VMware Tools, prompts VMCI, memory driver
- November 25th, 2024
- 102 Views
More Post
- Howo Tractor Truck
- Howo Tipper/Dump Truck
- Howo Cargo Truck
- Howo Concrete Mixer Truck
- Howo Special Truck
- Howo Light Truck
- Shacman Tractor Truck
- Shacman Tipper/Dump Truck
- Shacman Cargo Truck
- Shacman Concrete Mixer Truck
- LGMG Mining Trucks
- XCMG Wheel Loader
- XCMG Excavator
- XCMG Crane
- XCMG Asphalt Pavers
- XCMG Road Roller
- Shantui Bulldozer
Copyright © 2024 BBBBF All Rights Reserved.