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

Latest Posts: When the full content option is used, videos are not contained and shows with the original width and height #61477

Open
carolinan opened this issue May 8, 2024 · 4 comments · May be fixed by #61538
Labels
[Block] Latest Posts Affects the Latest Posts Block Needs Dev Ready for, and needs developer efforts [Type] Bug An existing feature does not function as intended

Comments

@carolinan
Copy link
Contributor

Description

In the latest posts block, when the option "Post content > Show full post" is used, videos have no width set on the front of the site. So they are not contained to the space that is allocated for the post. It expands outside the list item and covers / overlaps other content and can create a horizontal scroll bar.

For example in my test, I set the block to use a five column grid.
In the editor, the video was 107px wide and was contained to its column.
On the front, the video was 3016px wide, the media file's original width.

Step-by-step reproduction instructions

Create a new post and add a video block, or: a cover block or media & text block with a video.

Add a latests posts block (In the same post, a new post or page, or in a template, it does not matter).
Enable "Post content > Show full post" in the block settings panel of the latests post block.
Confirm that the video(s) are reasonably sized and does not overlap any other content in the editor.
Save and view the front of the site.
Note the size of the video.

Test both the grid layout with different columns and the default list view layout.

Screenshots, screen recording, code snippet

No response

Environment info

No response

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

@carolinan carolinan added [Type] Bug An existing feature does not function as intended [Block] Latest Posts Affects the Latest Posts Block labels May 8, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label May 9, 2024
@amitraj2203
Copy link
Contributor

Hi @carolinan I have raised a PR for its fix.

Thanks.

@carolinan
Copy link
Contributor Author

carolinan commented Mar 5, 2025

I tried adding this to style.scss. Because the width is one of the styles that are used for the video in both media & text block, video, and cover blocks.

.wp-block-latest-posts__post-full-content video {
	width: 100%;
}

✅ This works when the latest posts block uses the optional grid layout.
✅ It also works for the cover and video, if the latest post blocks is the default width (content width), because these videos are then limited to the width of the latest posts block.

❌ It does not work for the media & text block, the width is too large and the content part of the block is pushed down below the video.

❌ If the latest's posts block is set to wide or full width, the video is wide or full, and does not respect the width of the video that is set in the post content of the listed post.

@carolinan
Copy link
Contributor Author

I think there is a bigger issue with CSS for the inner blocks not loading when they are nested inside the latest posts block.

@carolinan carolinan added Needs Dev Ready for, and needs developer efforts and removed [Status] In Progress Tracking issues with work in progress labels Mar 5, 2025
@renatho
Copy link
Contributor

renatho commented Mar 11, 2025

I think there is a bigger issue with CSS for the inner blocks not loading when they are nested inside the latest posts block.

Yes! I did a quick exploration, and it seems the blocks are just not parsed inside the Latest Posts block. In the frontend and in the editor. I added some more details here (closed as duplicate of this one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Latest Posts Affects the Latest Posts Block Needs Dev Ready for, and needs developer efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants