#62243 closed defect (bug) (fixed)
Twenty Twenty: Latest post block there is no space between post-author/post-date and post content on the front-end.
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.8 | Priority: | normal |
| Severity: | minor | Version: | |
| Component: | Bundled Theme | Keywords: | has-patch has-unit-tests |
| Focuses: | css | Cc: |
Description
Hello Team,
I have checked "Latest Post" block and found that when we add post-author/post-date there is no space between post-author/post-date and post content on the front-end, But on the admin editor side it looks good, There is some space between post-author/post-date and post content.
For better understanding, Here I have attached its screenshots:
Thanks,
Attachments (7)
Change History (30)
@
19 months ago
I have checked above mentioned issue and I have resolved it and added patch. Also, I have attached screenshot after resolved this issue.
#1
@
18 months ago
Hey @viralsampat,
Thanks for raising this issue! I couldn’t reproduce it on my end.
Here’s what I tested:
- Twenty Twenty theme on WordPress versions 6.7 to 6.4
- Twenty Twenty theme on Local by Flywheel on WordPress 6.6
After checking the style.css file from core/latest-posts, I found this rule:
.wp-block-latest-posts__post-excerpt {
margin-top: 0.5em;
margin-bottom: 1em;
}
This CSS rule adds a top margin, which appears to be adding the gap.
You can view the relevant code here:
Could you please provide more details or any additional steps needed to replicate the issue?
Thanks!
#2
@
18 months ago
- Keywords reporter-feedback added; dev-feedback removed
- Summary changed from Twenty Twenty Theme: Latest post block there is no space between post-author/post-date and post content on the front-end. to Twenty Twenty: Latest post block there is no space between post-author/post-date and post content on the front-end.
@viralsampat are you still able to reproduce this issue?
@
18 months ago
adds 1em top margin to a paragraph if it is the first element in the post content, within a Latest Posts block
#3
@
18 months ago
- Keywords has-patch added; needs-patch reporter-feedback removed
- Severity changed from normal to minor
The lack of space can occur when
- the Latest Posts block is set to show "Full post" and
- the first element/block in the post is a paragraph.
The excerpt option has a small margin from block styles (GB15722), but #47340 added a margin for the full post option in Twenty Nineteen and PR 153 set the same top margin for both options in Twenty Twenty-One.
In Twenty Twenty, paragraphs have zero top margin. In contrast, a heading as the first block can have a top margin of 3.5rem or more, and the Image block has a 4rem margin.
Patch notes:
- If the selector targets the paragraph element, it needs to apply only when that paragraph is at the beginning of the post. 62243.1.patch uses
.wp-block-latest-posts__post-full-content > p:first-child. - Targeting the
.wp-block-latest-posts__post-full-contentdiv is another option. It would give a minimum margin above the post content, and I did not notice that rule increasing the space when the first inner block has its own margin. - If this were the newest theme, I would suggest giving the
:first-childa consistent margin regardless of the element. However, five years later, I would prefer to keep any changes minimal. - The
.entry-contentclass (62243.patch) would apply styles only within page/post content, and the Latest Posts block is intended for the Widgets area(s).
#4
@
18 months ago
- Keywords needs-testing removed
Test Report
Description
This report validates that the suggested patch works as expected.
Patch tested: 62243.1.patch
Environment
- WordPress: 6.8-alpha-59274-src
- PHP: 8.2.25
- Server: nginx/1.27.2
- Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.25)
- Browser: Chrome 131.0.0.0
- OS: macOS
- Theme: Twenty Twenty 2.8
Actual Results
✅ Issue resolved with the patch.
Supplemental Artifacts
Back-end: https://postimg.cc/xJn7Vv85
Front-end: https://postimg.cc/QFn13hMy
#6
@
18 months ago
- Keywords commit added
In testing, I can confirm this is still an issue, but the patch uploaded by @sabernhardt resolves it. I am, therefore, going to move this to commit now. Thank you, everyone.
#7
@
18 months ago
- Owner set to karmatosed
- Resolution set to fixed
- Status changed from new to closed
In 59470:
This ticket was mentioned in PR #10868 on WordPress/wordpress-develop by @adamsilverstein.
3 months ago
#9
- Keywords has-unit-tests added
This PR contains the PHP backports for the client-side media processing feature, enabling the editor to perform client-side image resizing, thumbnail generation, and format conversion using WebAssembly.
## Preloaded Settings
The following site settings are now preloaded in both the post editor and site editor:
image_sizes- Available image size configurationsimage_size_threshold- Big image size threshold (default 2560px)image_output_formats- Output format mappings for image conversionjpeg_interlaced- Whether to use progressive/interlaced JPEG encodingpng_interlaced- Whether to use interlaced PNG encodinggif_interlaced- Whether to use interlaced GIF encoding
## REST API: Index Endpoint
Added media processing settings to the REST API index (/wp-json/wp/v2/):
image_sizes- All registered image sizes with dimensions and crop settingsimage_size_threshold- Big image size thresholdimage_output_formats- Format conversion mappings
## REST API: Attachments Endpoint
### New Fields
filename- Original attachment file namefilesize- File size in bytesexif_orientation- EXIF orientation value (1-8) for client-side rotation handling
### New Parameters
generate_sub_sizes- When false, disables server-side sub-size generation and EXIF rotationconvert_format- When false, disables automatic image format conversion
### New Sideload Endpoint
Added /wp/v2/media/{id}/sideload endpoint for uploading sub-sized images to an existing attachment. Used by client-side media processing to upload generated image sizes without creating new attachments. Supports both images and PDFs.
### PDF Improvements
Improved missing_image_sizes field handling for PDFs, which use the fallback_intermediate_image_sizes filter instead of wp_get_missing_image_subsizes().
## Cross-Origin Isolation
Added COOP (Cross-Origin-Opener-Policy) and COEP (Cross-Origin-Embedder-Policy) headers in the block editor to enable SharedArrayBuffer for WebAssembly-based processing. Includes:
- Output buffer to automatically add
crossorigin="anonymous"attributes to external resources - Media templates updated with crossorigin attributes for audio, img, and video tags
## WASM Support
Added AddType directive for WebAssembly files to .htaccess rules, enabling serving .wasm files for client-side media processing libraries like wasm-vips.
## Tests
Updated REST API tests for the new attachment fields and sideload endpoint.
---
Gutenberg PRs:
- https://github.com/WordPress/gutenberg/pull/74566
- https://github.com/WordPress/gutenberg/pull/74908
- https://github.com/WordPress/gutenberg/pull/75112
- https://github.com/WordPress/gutenberg/pull/74909
Gutenberg tracking issue: https://github.com/WordPress/gutenberg/issues/75062
@adamsilverstein commented on PR #10868:
3 months ago
#10
Sorry for what may be an unsolicited early review, as the PR is still a draft.
No worries, happy to have your feedback. Indeed I started working on this pr before the Gutenberg work had merged to get ahead and be more prepared - so it may change a bit, but probably not much at this point.
@andrewserong commented on PR #10868:
3 months ago
#11
Just a quick comment: it looks like this accidentally removes the ca-bundle.crt file, so I assume needs a rebase?
@adamsilverstein commented on PR #10868:
3 months ago
#12
Just a quick comment: it looks like this accidentally removes the
ca-bundle.crtfile, so I assume needs a rebase?
oh, i thought i had added that file. will fix. Also figured out why this isn't working, fix incoming.
@adamsilverstein commented on PR #10868:
3 months ago
#13
Just a quick comment: it looks like this accidentally removes the
ca-bundle.crtfile, so I assume needs a rebase?
rebased and fixed.
@adamsilverstein commented on PR #10868:
3 months ago
#14
This is ready for additional testing, client side processing is now working as expected. In addition to smoke testing as is, it would be good to test with wp_is_client_side_media_processing_enabled set to false to verify server side processing kicks in as expected.
@adamsilverstein commented on PR #10868:
3 months ago
#15
@westonruter I believe I have addressed all outstanding feedback (except the output mapping one I will work on in a follow up). Can you give it another spin?
@mukesh27 commented on PR #10868:
3 months ago
#16
@adamsilverstein have you checked why unit tests are failed?
@adamsilverstein commented on PR #10868:
3 months ago
#17
@adamsilverstein[[Image(chrome-extension://hgomfjikakokcbkjlfgodhklifiplmpg/images/wp-logo.png)]] have you checked why unit tests are failed?
looking now...
@adamsilverstein commented on PR #10868:
3 months ago
#18
@adamsilverstein[[Image(chrome-extension://hgomfjikakokcbkjlfgodhklifiplmpg/images/wp-logo.png)]] have you checked why unit tests are failed?
looks like I just needed to update the wp-api fixtures which i did in 57c4f00 (by running the test_build_wp_api_client_fixtures test locally)
#21
follow-up:
↓ 22
@
3 months ago
We are facing some problems with our worker on Yoast SEO with WP 7.0 beta or latest Gutenberg. It seems that the problem is related to the CORS headers changes introduced with this ticket. Is this an expected side-effect?
#22
in reply to:
↑ 21
@
3 months ago
problem is related to the CORS headers changes
@lopo For the client-side media ticket, please see #64597.
This ticket was mentioned in PR #11168 on WordPress/wordpress-develop by @adamsilverstein.
2 months ago
#23
## Summary
- Adds a
POST /wp/v2/media/{id}/finalizeREST API endpoint toWP_REST_Attachments_Controller - The endpoint triggers the
wp_generate_attachment_metadatafilter with context'update'after client-side media processing completes - Ensures server-side plugins (watermarking, CDN sync, custom sizes, etc.) can post-process attachments when client-side processing is active
- Only registered when
wp_is_client_side_media_processing_enabled()returns true
## Context
When client-side media processing handles image uploads (resizing, thumbnail generation, format conversion), server-side WordPress hooks like wp_generate_attachment_metadata are bypassed. This endpoint is called after all client-side operations (upload, thumbnail generation, sideloads) are complete, re-triggering the filter so plugins continue to work.
### Hook usage example
add_filter( 'wp_generate_attachment_metadata', function( $metadata, $attachment_id, $context ) {
// $context is 'update' when called from the finalize endpoint.
if ( 'update' === $context ) {
// Add watermark, sync to CDN, generate custom sizes, etc.
my_plugin_process_attachment( $attachment_id, $metadata );
}
return $metadata;
}, 10, 3 );
## Changes
| File | Change |
|---|---|
class-wp-rest-attachments-controller.php | Add finalize route registration, finalize_item_permissions_check(), and finalize_item() methods
|
rest-attachments-controller.php (tests) | Add tests for finalize endpoint (success, auth required, invalid ID) |
rest-schema-setup.php | Add finalize route to expected routes list |
wp-api-generated.js | Add finalize route to API fixtures |
## Test plan
- [ ] Verify finalize endpoint returns 200 with valid attachment
- [ ] Verify
wp_generate_attachment_metadatafilter fires with context'update' - [ ] Verify 401 when not authenticated
- [ ] Verify 404 for invalid attachment ID
- [ ] Run full REST API test suite
## Related
- Gutenberg PR: https://github.com/WordPress/gutenberg/pull/74913
- Gutenberg issue: https://github.com/WordPress/gutenberg/issues/74358
- Previous CSM backport PR: https://github.com/WordPress/wordpress-develop/pull/10868
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
🤖 Generated with Claude Code
Back-end