the_excerpt()
does not recognise or support the <!-- more -->
tag. From the documentation:
The
<!--more-->
quicktag requires templates to usethe_content()
whereas using excerpts requires, and allows, template writers to explicitly choose whether to display full posts (usingthe_content()
) or excerpts (usingthe_excerpt()
).
The point is that the_excerpt()
allows theme authors (you) to require an excerpt. This is automatically created by trimming the content, but if the user needs a specific excerpt then they can enter a manual excerpt. Either way they cannot accidentally display the full post content.
On the other hand the_content()
lets the user decide whether or not to use an excerpt. If they do want one, then they use the <!-- more -->
tag. If they don’t, then they leave it out and the full post will be displayed.
As a theme author you need to decide which you should support. If displaying the full content of the post would break your layout, then you should use the_excerpt()
, but if the theme would look fine either way, then use the_content()
.
If you want the user to decide between these options then you could create a Customiser setting that let’s the user choose. Then in your templates you could check this value and use the appropriate tag:
<?php
if ( 'excerpt' === get_theme_mod( 'setting_name_here' ) ) {
the_excerpt();
} else {
the_content( '', true );
}
?>