Truncating the_content
-
I am using a child theme of twenty fifteen.
I have this code in my content.php filethe_content( sprintf( __( '<br />Read more %s', 'twentyfifteen' ), the_title( '<span class="screen-reader-text">', '</span>', false ) ) );
This shows the full post content in both the post list and full post pages.
If the editor has used the ‘Insert Read more’ button a truncated version of the post shows on post list pages. This is all good, however…
If the editor has not used the ‘Insert Read more’ button I would like to be able to truncate the content to so many words and keep the Read more link working just as it is.
Is this possible?I have tried using the excerpt instead, but then I lose my Read more link.
Thanks for any help!
- The topic ‘Truncating the_content’ is closed to new replies.