What you can do is use the <!--more-->
tag. That is, when you edit your post, paste in that tag where you want the excerpt to end. It is a bit of a bother editing each post, but using the <!--more-->
tag has a lot of advantages. For one, you get to choose how much of your post you want to display for your excerpt. When a theme lets WordPress create its default excerpt, it’s usually 55 words long, which means an excerpt will often end in the middle of a sentence. Using the <!--more-->
tag means you can display one sentence, a paragraph, or even two paragraphs.
Another advantage to using the <!--more-->
tag is that all of the formatting will remain intact. That is, with WordPress’ default excerpt, all formatting tags (like bold, italic, underline, etc), gets stripped out. Using the <!--more-->
tag leaves the formatting in the excerpt. Also, any images which you include before the <!--more-->
tag will also be displayed, where the standard WordPress generated excerpt leaves out images.
Oh, and if you don’t want to copy & paste in the <!--more-->
tag, you can just click the more button in the editor tool bar and it will automatically paste in the <!--more-->
tag for you (make sure you are using the Text editor and not the Visual editor).
Thread Starter
lytice
(@lytice)
What if i don’t want to use the more tag?
Then you can create a child theme, make a copy of the content.php file from the parent theme folder to your child theme folder, then look for these lines in content.php:
<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-content">
<?php the_excerpt(); ?>
</div>
Change the first line so that it looks like this instead:
<?php if ( is_search() || is_home() ) : // Only display Excerpts for Search and Home ?>
<div class="entry-content">
<?php the_excerpt(); ?>
</div>
That is, you add the is_home() function so that excerpts are also output for the home page and not just the search results.
What you should not do is edit the theme files directly. Otherwise, your changes will be lost the next time you update the theme (and you should make sure you are always running the latest version, in case there are bug fixes, security patches, or changes made because of corresponding changes to the WordPress core). Or, you can edit the theme files directly but you’ll need to make sure you make this modification every time you update the theme.