Excerpt is a good way to shorten your article, it’s more like a summary of the article. Other than front page, some themes may use excerpts on the archive pages as well.The default WordPress excerpts are limited to first 55 words of the content and ends with ellipsis […] at the end of the paragraph.
To display an excerpt of the post, you may use <?php the_excerpt(); ?>
in the loop. Please refer to WordPress Codex page for more info about this.
Customize […] in WordPress excerpts
If you’d like to change the […] in the excerpts to something more useful like Read More, you may use the code below. You may also want to change the text to other word. The text will be linked to the permalink of the post.
1 2 3 4 5 6 7 8 9 10 11 12 |
|
As you can see from the code above, I added the .more-link
class so you can further customize the output of the Read More link.
Remove […] from WordPress excerpts
To remove […] from the excerpts, you may use the following code. The code should be in functions.php file of your child theme.
1 2 3 4 5 6 7 8 |
|
If you’ve any question about the WordPress excerpts, feel free to leave your comment below.
Tiyo Kamtiyono says
Simple, and something that must to be understood, but I often don’t pay attention to this. What I don’t really understand is your first script on the sixth until tenth line, why is there an if-else?
Thanks before
Lily says
This article was really helpful to me, thank you. (I was having a hard time trying to get change those ellipses.)
But I do have a question. Is there a way to have just the 3 dots (without the brackets) after the excerpt AND the read more link underneath that?
Because right now the excerpt gets cut off abruptly, and although there is the read more box underneath, it still looks a bit unfinished. (you can see that here: http://www.ashestobeauty.net/blog/) . So if it’s not too much trouble, how do I have both, but without the brackets?
thank you!!
I love WP says
Works great, thanks!
Maksim says
perfect post, everything works great!
could you please help how to remove a space after excerpt?
I changed […] to simple …
removed tags in your code to hold it on one line, but still have a small issue.
Example: “this is a last word in current line …”
That space is killing me.
Thank You!
marko says
Thank You !!!