fix the first query item doesn't display except#2875
Merged
outdoor2kode merged 2 commits intotrunkfrom Sep 5, 2024
Merged
Conversation
adamwoodnz
reviewed
Sep 5, 2024
| * Inserter: no | ||
| */ | ||
|
|
||
| get_the_excerpt(); |
Contributor
There was a problem hiding this comment.
Suggested change
| get_the_excerpt(); | |
| // Workaround for the first lesson in the grid not having an automatic excerpt generated | |
| get_the_excerpt(); |
Contributor
There was a problem hiding this comment.
Tested and this works for me, so I think it's good to merge as a workaround, with a comment. I think it would still be good to understand where this is failing though, and potentially raise a Gutenberg bug.
Contributor
Author
There was a problem hiding this comment.
Yeah, I spent some time looking into it, but couldn't find what part is causing the issue. There isn't any related discussion in Gutenberg either. Have already spent more time on this than expected, so just go with a workaround. I'll look into further the flow for this part in Gutenberg, and still can't figure it out, I'll open a ticket.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2682
It appears that the first post result of a query doesn't render an automatically generated excerpt due to an ordering issue or because
get_the_excerptis not being called. The automatic excerpt will only be generated after a get_the_excerpt call.I couldn't find a relevant hook to solve this in the source code for the post-template block and post-excerpt block, so a
get_the_excpertis added at the start.Screenshots
Tested in the sandboxed environment, and everything looks fine. I also went through 20 pages, and they look good.