A theme can add support for the bundled block styles using a single line of code. This ensures that what a publisher sees on the back end in the block editor matches what the visitor sees on the front end.
- [Instructor] One thing you notice immediately when using…a theme without block support is some of the blocks,…like the quote block here, look not great.…And more importantly, there's a disconnect…between what we see on the front end…and what we see on the back end.…The styling of these blocks do not match on the front…and back end, which is a really confusing experience…for the end user.…To remedy this situation immediately,…we can declare support for default…block styles in the theme.…This adds a style sheet to the front end,…which matches the one used by the block…editor on the back end.…
This is all done in the files for the theme itself.…So I've opened up the theme in my code editor,…and any change I make in the theme now…will immediately be reflected on…the front end in my browser.…What I'm looking for here is to add new theme supports,…and that's always done towards the top of function…thought PHP in a custom function.…So when we scroll down here, you'll see there's a ton…of references to add theme support.…
Released
1/22/2019- Declaring support for default block styles
- Adding support and styles for wide alignment
- Supporting theme-specific colors and fonts
- Extending block styles
- Adding new style variations
Share this video
Embed this video
Video: Declare support for default styles