[Solved] How to Limit the_excerpt() Character Length in WordPress
Pretty posts
Sometimes you want to try limit the character length in WordPress default the_excerpt() length. See following method how to limit the character length.
Code: In your function.php file add following code.
/** * Changing excerpt length * www.codiblog.com */ function get_excerpt($count){ $permalink = get_permalink($post->ID); $excerpt = get_the_content(); $excerpt = strip_tags($excerpt); $excerpt = substr($excerpt, 0, $count); $excerpt = $excerpt.'...'; return $excerpt; }Then where you used
<?php the_excerpt(); ?>
, you need to replace this by following code<?php echo get_excerpt(36); ?>You can change character length value 36 as your wish.
No Comment to " [Solved] How to Limit the_excerpt() Character Length in WordPress "