#52461 closed defect (bug) (invalid)
the_excerpt() not respecting <!--more--> tag on single-post pages.
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
Hello there, I've never reported a WordPress bug before, so bear with me. I'm been working with a reputable theme developer, Themeco, with an issue I was trying to resolve, and [according to their estimation](https://theme.co/forum/t/layouts-and-post-excerpts-bug/83415/14/), it appears to be either an issue with WordPress core or an issue with the WordPress documentation being inaccurate. In either case, I'l like to report it as succintly as possible and hopefully get it resolved.
According to [your documentation here](https://codex.wordpress.org/Customizing_the_Read_More), I should be able to enter a <!--more--> tag or the corresponding "Read More" block in the block editor and that should limit what the_excerpt() returns to the text before the more tag (instead of the 55 word limit). And, indeed, it does so everywhere except for the single-post page. On the single-post page, it either returns the manual excerpt or it returns the 55 character limit if there is no manual excerpt.
I may not be doing a good job describing this, so please see [this thread](https://theme.co/forum/t/layouts-and-post-excerpts-bug/83415) for a fuller explanation of the issue. This may appear trivial, but I have reasons for wanting this functionality to work for a site I am working on.
You have misinterpreted the documentation.
The
the_content()
function called from an archive page (one that shows multiple posts) is the only one that handles the More tag, by truncating the content. When on the single post page, the More tag generates the ID attribute for the More link where the More tag is placed.The
the_excerpt()
function retrieves the manually entered excerpt and if it is empty, an excerpt is generated from the content by stripping HTML tags and counting words according to the excerpt_length.