Block CSS and insert block part into classic theme templates. #50821
jstuartj
started this conversation in
Developer Experience
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm building a theme framework that can fall back to classic PHP template when needed. The way I understand it, FSE/Block themes load CSS wp_head() not in the body. And we need to use do_blocks() prior executing wp_head() and then echo those blocks in body.
So, I've created the following functions to preload a single or an array of block parts. Render them with do_blocks(), and then parse them into an associative array. Which I can then use to insert them into at point in a classic theme's body.
Is there a better way to accomplish this? Besides building custom blocks and or pattern.
Beta Was this translation helpful? Give feedback.
All reactions