• Login
    • Home
    • WordPress tutorials
    • Freelancing
    • Categories
      • Airtel Free Net Offers
      • Andriod Tips & Tricks
      • Banglalink Free Net Offer
      • Education Tips and Suggestion
      • Gp Free Internet tips
      • Graphics Design
      • Online income tutorials
      • Pc software update
      • Tech News
      • Web design
      • WordPress tutorials
      • Youtube Tutorials
Purebdinfo.com
    • Home
    • WordPress tutorials
    • Freelancing
    • Categories
      • Airtel Free Net Offers
      • Andriod Tips & Tricks
      • Banglalink Free Net Offer
      • Education Tips and Suggestion
      • Gp Free Internet tips
      • Graphics Design
      • Online income tutorials
      • Pc software update
      • Tech News
      • Web design
      • WordPress tutorials
      • Youtube Tutorials
  • Login
Home » Wordpress tutorials » How to Display the post excerpt in WordPress without plugin

How to Display the post excerpt in WordPress without plugin

Wordpress tutorials
  • Ahamed Sojib
  • 0
  • 2 years ago
  • 562
How to Display the post excerpt in WordPress without plugin

How to Display the post excerpt in WordPress without plugin

Basically, when we visit some websites then we see some website use post excerpt in the Recent post. If you want to display the post excerpt to your website.  you can use some plugin but today I will show how to display post excerpt to your  WordPress website without Plugin.

 

Usually, have two types of   Post excerpt  Such as Post excerpt by word and excerpt by character. I will show you the excerpt by character.
At first paste this below code in the function.php and  click save.
<?php



function excerpt($limit) { $excerpt = explode(' ', get_the_excerpt(), $limit); if (count($excerpt)>=$limit) { array_pop($excerpt); $excerpt = implode(" ",$excerpt).'...'; } else { $excerpt = implode(" ",$excerpt); }  $excerpt = preg_replace('`[[^]]*]`','',$excerpt); $excerpt = $excerpt.'... <a href="'.get_permalink().'">'; return $excerpt;; }
	
	
function content($limit) { $content = explode(' ', get_the_content(), $limit); if (count($content)>=$limit) { array_pop($content); $content = implode(" ",$content).'...'; } else { $content = implode(" ",$content); }     $content = preg_replace('/[.+]/','', $content); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]&gt;', $content); return $content; }
	
	

	?>

Finally, The final steps now . just paste this below code where you want to show excerpt this post.but keep mind in the first   (30) how much digits put inside then the number of digits character showing post excerpt.

<?php  echo excerpt(30);?> <a href="<?php the_permalink() ?>"> [Read More] </a>

 

 

Thanks  for reading this post . If you like this post please hits subscribe button our YouTube channel .

 

Releted Post

How to add new item in the woocommerce my account page

How to disable WordPress admin bar from front end without plugin

Create a WordPress custom post type without plugin

QUICK LINKS
  • About us
  • Advertise
  • Terms And Use
  • Contact PureBDinfo Support Team
QUICK LINKS
  • Home
  • About us
  • Copyright Rules
  • Terms And Use
Follow US

Copyright © All rights reserved