Skip to content

Add WordPress-style body classes to Faust pages #2682

Closed

Description

@josephfusco

WordPress themes get classes like home, single-post, postid-123 and logged-in on <body> from body_class(). Faust pages don't, so CSS ported from a theme loses those hooks. The Toolbar already adds admin-bar by hand and notes this could become a Faust hook (Toolbar.tsx).

  • Work out the classes from the seed node Faust already loads, with an opt-in hook such as useBodyClass().
  • Have the Toolbar use it for admin-bar.
  • Matching core's body_class() exactly (including its filters) is out of scope, because that needs WordPress's main query.

Open question: which classes are worth supporting first?

Activity

  1. added
    [Area] CoreIssues for the @faustwp/core package
    [Type] EnhancementA suggestion for improvement of an existing feature
    on Oct 20, 2026
  2. self-assigned this
    on Oct 20, 2026
  3. josephfusco commented on Oct 21, 2026

    @josephfusco
    MemberAuthor

    Someone asked me for this in person at WordCamp US: carrying a WordPress theme's body-class-based CSS over to a Faust frontend. #2689 adds it as an opt-in.

  4. moved this from 🆕 Backlog to ✅ Closed in Headless OSSon Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Area] CoreIssues for the @faustwp/core package[Type] EnhancementA suggestion for improvement of an existing feature

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions