How to Short your Post and Add “Read more” link in WordPress?

WordPress came with lot’s build-in Feature . there is lot’s of build-in function as you can build your theme easily . but some time we need to heck some function to show in our way . so let’s today we will see How to Short your Post and Add “Read more” link in WordPress?  .how-to-short-your-post-in-wordpress

if you have basic coding knowledge, and you can put code in your theme , so this solution for you . First go to Appearance > Editor .

then put this code into your theme function.php file

function excerpt($num) {
$limit = $num+1;
$excerpt = explode(' ', get_the_excerpt(), $limit);
array_pop($excerpt);
$excerpt = implode(" ",$excerpt)." .";
echo $excerpt;
} 

if you know how edit php code you edit this line for show read more button class

implode(" ",$excerpt)." .";

then call this function where you want to show, you can put number ,as How many word you want to show.

echo excerpt(50); 

Please Don’t use this if you don’t know how to code php . and before do this take full backup of your website . thank you reading . please join with us in facebook , twitter.

Leave a Reply

Your email address will not be published. Required fields are marked *