Need Help About Excerpt

MafiaBlack

BANNED
Joined
Mar 23, 2011
Messages
579
Reaction score
109
Guys i need help about these 2 things..

JYCkkqg


1- How to replace [...] with words like [Read More] or [Continue Reading] Etc

2- How to make the words long like 200-300 words before [...]
 

Attachments

  • JYCkkqg.webp
    JYCkkqg.webp
    10.5 KB · Views: 2
1. Change [...] string

By default, excerpt more string at the end is set to '[...]'. To change excerpt more string using excerpt_more filter, add the following code to functions.php file in your theme:

Code:
function new_excerpt_more( $more ) {
    return '[Read More]';
}
add_filter('excerpt_more', 'new_excerpt_more');

2. Change Excerpt Length

By default, excerpt length is set to 55 words. To change excerpt length to 200 words using excerpt_length filter, add the following code to functions.php file in your theme:

Code:
function custom_excerpt_length( $length ) {
    return 200;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
 
Thanks bro it works.. Do you know how to make 'read more' clickable? I mean we can insert post's link.. SO when reader click on read more they will redirect to the full post
 
BUMP.. Need Urgent Help
 
Last edited:
Replace
Code:
function new_excerpt_more( $more ) {
    return '[Read More]';
}
add_filter('excerpt_more', 'new_excerpt_more');

with

Code:
function new_excerpt_more( $more ) {
    return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">[Read More]</a>';
}
add_filter( 'excerpt_more', 'new_excerpt_more' );
 
Back
Top