Skip to content
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

Regression: post excerpt block's excerptLength attribute is ignored, excerpt length is always limited to 55. #68996

Closed
4 of 6 tasks
skorasaurus opened this issue Feb 1, 2025 · 2 comments
Labels
[Block] Post Excerpt Affects the Post Excerpt Block [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release

Comments

@skorasaurus
Copy link
Member

skorasaurus commented Feb 1, 2025

Description

The Post Excerpt block is intended to display up first 100 words of an excerpt, as mentioned when first introduced - #44964 (comment)

However, some time since then,

The excerpt block will only display, at most, the first 55 words of a post (the default value of the excerptlength attribute), even if you just adjust the excerpt block's attributes to more than 55.

The excerptLength attribute will correctly display the number of words on the front end if the ExcerptLength attribute value is below 55.

Step-by-step reproduction instructions

  1. create and publish a few posts of post type post that contain more than 100 words in each post; do NOT set a custom excerpt.
  2. create a new page
  3. insert new query block
  4. include the excerpt in the post template and set the excerpt's attribute to a value above 55. I have a test case here, which assigns the value to 75
  5. publish page

What happens:
the excerpts that displays on the published page are 55 words. You'll see in the video that this issue occurs within the editor and on the front end.

Note, there is an open pull request to fix this, #61888

Screenshots, screen recording, code snippet

Screencast.from.02-01-2025.06.14.47.PM.webm

Environment info

wp 6.7.1, gutenberg 20.0.1; twentytwentyfive theme

I'm also able to reproduce this issue in my custom hybrid theme as well that does not have gutenberg plugin enabled.

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@skorasaurus skorasaurus added [Block] Post Excerpt Affects the Post Excerpt Block [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release labels Feb 1, 2025
@Mamaduka
Copy link
Member

Mamaduka commented Feb 2, 2025

Good catch, @skorasaurus!

I think excerpt length logic also needs an update after - https://core.trac.wordpress.org/changeset/58065.

@swissspidy, do you know if anyone created a follow-up PR in Gutenberg?

@swissspidy
Copy link
Member

Nope, the issue is still open, see #53570

I suggest closing this one as a duplicate.

@Mamaduka Mamaduka closed this as completed Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Excerpt Affects the Post Excerpt Block [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

No branches or pull requests

3 participants