Skip to content

Blocks CSS additional CSS is missing on archive pages #3066

Description

@pirate-bot

Summary

Blocks CSS additional CSS applied to blocks can be absent when those blocks appear on archive pages. The archive output is expected to retain the block-specific CSS configured in the editor, but the archive request does not collect CSS from the posts rendered in the archive loop. Affected archive entries therefore appear without their configured styling.

Customer context

Product / area: Blocks CSS, frontend archive rendering
Version: 3.2.5
Environment: WordPress version, theme, archive type, and PHP version were not provided
Integration / third party: None reported
Reported error / symptom: Additional CSS is not applied on archive pages
Impact: Archive content can render without block-specific styling
Usage context: The plugin had been active for 189 days before deactivation

Reproduction notes

Reported workflow:

  1. Configure additional CSS for a block through Blocks CSS 3.2.5.
  2. Publish content containing that block.
  3. View an archive page that displays the content.
  4. Observe that the configured CSS is absent.

Repository-confirmed limitation: the standalone frontend renderer processes at most one global post during wp_head and does not traverse archive-query posts. A runtime reproduction was not performed because the report does not provide the theme, archive type, or excerpt/full-content configuration.

Diagnosis

Conclusion

The standalone Blocks CSS frontend path does not collect custom CSS from all posts rendered by an archive query. In version 3.2.5 it runs during wp_head, gates processing on get_the_ID(), and parses only the current global post's content. Even if a global post is available at that point, the path has no iteration over the archive result set, so CSS belonging to other archive entries is omitted. This matches the reported archive-page symptom.

Where this likely occurs

  • inc/class-blocks-css.php — Blocks_CSS::init() lines 25–36 registers render_server_side_css() on wp_head.
  • inc/class-blocks-css.php — Blocks_CSS::render_server_side_css() lines 106–165 checks one get_the_ID(), reads one global $post, and parses only $post->post_content outside its narrow block-template branch.
  • inc/class-blocks-css.php — Blocks_CSS::cycle_through_blocks() lines 176–210 extracts customCSS only from the supplied block tree, so archive posts not supplied by the caller cannot contribute their CSS.
  • plugins/blocks-css/blocks-css.php — plugin header lines 10–22 identifies the reported standalone product and version 3.2.5.
  • Closed issue Custom CSS styles missing on Archive pages #1373, Custom CSS styles missing on Archive pages, described the same symptom. It was closed in 2023 after limited testing and no additional reports, not because a source change was identified. The affected source path is still present in tag v3.2.5.

Engineering notes

The inspected defect is specific to the standalone Blocks CSS rendering path. When Otter Blocks is active, Blocks_CSS::add_css_to_otter() participates in Otter's separate CSS pipeline, so that combination has a different data flow. Archive behavior may vary by classic theme, block theme, and whether archive entries render full content or excerpts, but the standalone path does not enumerate multiple queried posts in any of those cases. WordPress core lifecycle details were not verified from local source; the confirmation does not depend on whether a first global post happens to be populated at wp_head, because the code still considers at most one archive post.

Test coverage status

No unit, integration, or end-to-end coverage for Blocks_CSS::render_server_side_css() or standalone archive CSS rendering was found during inspection. Existing CSS tests cover CSS utilities and file handling rather than this frontend archive path.

What to verify or explore next

  • Reproduce with Blocks CSS 3.2.5 without Otter active, using a category or date archive containing at least two posts with distinct block-level custom CSS.
  • Compare a classic-theme archive using full content with one using excerpts.
  • Verify the same workflow with a block theme and an edited archive template.
  • Check whether CSS is emitted for the first archive result, later results, or neither by inspecting the rendered page source.
  • Run the relevant PHP and frontend suites if archive-path coverage is added.

Unknowns / follow-up

The feedback does not identify the archive type, theme, whether excerpts were used, or whether Otter Blocks was active alongside Blocks CSS.

Confidence

Confidence: 90/100

Version 3.2.5 source confirms that standalone Blocks CSS derives frontend CSS from only one global post during wp_head and does not traverse archive-query posts; the exact symptom was previously tracked in closed issue #1373, but the affected path remains in the reported release.


Source: automated uninstall feedback — blocks-css, 2026-09-20
Generated by bug-report-triage (ID: bug-report-triage_6ab0ba48227f36.80344460)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions