Content before the More button is truncated and unavailable if it's too long and if the excerpt is hidden on full page #44062
Description
Description
When the More block is added to a post, only the content before it should appear on the archives page. This is true only if the content before the More block isn't too long: if it's long enough, it's instead truncated and only the beginning of it appears on the archive page (possibly, together with the "Read more link text" that can be set in the editor).
The problem is that, when one selects the option of the More block to "Hide the excerpt on the full content page", the truncated part of the content before the More block itself doesn't show anywhere in the front end.
I'm not sure what the expected behavior in this situation should be: either everything before the More block should appear on the archive page, independently of its length, or the truncated content should appear on the full content page, which can be complicated as the content can be truncated even in the middle of a sentence.
I tend to think that the expected behavior should be the former, as it would respect the choice of the content creator.
Step-by-step reproduction instructions
- Install WordPress. The Gutenberg plugin is not needed, but installing it makes no difference.
- Create a new post. The post should contain three blocks.
- A Paragraph block containing enough content for it to be truncated on the homepage.
- A More block, with the "Hide the excerpt on the full content page" toggle active (the option is in the sidebar).
- Another Paragraph block.
- Visit the full content page and check that only the Paragraph block after the More block is on display.
- Visit the homepage of the website and check that the content before the More block is truncated. The truncated content is available nowhere on the website.
Screenshots, screen recording, code snippet
Here is a possible post that allows reproducing the bug.
This is the full content page: only content after the More block is displayed.
This is the homepage: the content before the More block is truncated and what follows appears nowhere.
Environment info
- WordPress 6.0.2.
- Tested both without Gutenberg and with Gutenberg 14.0.2.
- Reproduced both with Twenty Twenty-Two and Twenty Twenty-One themes. The bug doesn't appear in Twenty Twenty, possibly because this theme doesn't show excerpts, not even when they are explicitly added to a post.
- Browsers: Chrome 105.0.5195.102, Edge 105.0.1343.33, Firefox 104.0.2, Firefox Developer 105.0b9, Opera 90.0.4480.84.
- Laptop with Windows 10 Home.
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes