-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ Latest Posts ] Appending "Read More" to the excerpt is inconsistent with some default themes #20510
Comments
I'm also encountering this in our custom theme and would like advise on what I should expect to be used; I too expected that excerpt_more since we customize that text. Using the This behavior is present in Gutenberg 7.6.0 as well as deactivating the gutenberg plugin and relying on Gutenberg that is built into |
Related to #20511, in #20541 I removed the appending of read more by the What do you think of this solution? Also, an important question: how could the block be aware of what the theme does to that "read more" text? |
I think that's a good idea, for the appending to only happen within the filter.
I don't think there's a perfect solution to this, but what I mentioned above in the ticket might get pretty close: use |
I think your PR is on the right path; we shouldn't automatically detect whether 'read more' is contained in the latest posts block. EDIT: Additionally by hard coding the 'read more' in the latest posts block, theme developers aren't able to either modify that without extensive hacking of using regular expressions to search and replace the 'read more' text. (I would highly discourage hard coding 'read more' into the latest posts block). Modifying the text at the end of an automatically generated excerpt has been possible through the excerpt_more hook (For context, twentytwenty only modifies excerpts when it's a more tag ( |
#20541 looks good for fixing this edge case, and partially fixes this issue. When the option to display "Post content" is turned on it seems to mix two different WP features: post excerpts and the Thinking it's worth it revisiting/improving how the "Post content" option is handled. Seems better to use a consistent, auto-generated, text only excerpts that will also respect the length set by the user. |
A report was made about this here: #3034519-zen |
Given that #20541 was merged, could we close this issue? @draganescu |
I think so yes. |
Describe the bug
When the excerpt is enabled in Post content settings, the block attempts to check if the default
…
that is appended to trimmed excerpts has been modified. If not, it appends a "Read More" link to the end of the excerpt. The problem is, the substring that it's looking for is not accurate for determining if modification has already happened. This causes unintended behavior in some default themes:excerpt_more
with their own "Continue Reading" link, but still use…
as well, so this causes there to be two separate, redundant links at the end of each excerpt.excerpt_more
at all, but this also isn't detected correctly by Latest Posts, because the default string is'[…]'
, while Latest Posts is looking for' … '
(note the spaces). So in these themes, the excerpts don't get any "Read More" link at all, though it seems like the intention is that they should.To reproduce
… Continue readingRead more
at the end of each post. Note that this isn't what is shown in the block preview.[...]
at the end, but no "Read More" link. Note that this isn't what is shown in the block preview.Expected behavior
Ideally, I think, the Latest Posts block would make a
has_filter
check onexcerpt_more
and skip appending anything if that returnstrue
, rather than checking for an arbitrary string.Screenshots
Twenty Sixteen frontend:
Twenty Sixteen editor:
Twenty Twenty frontend:
Twenty Twenty editor:
Desktop
The text was updated successfully, but these errors were encountered: