From the course: WordPress Content Blocks: Working with Themes

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Declare support for default styles

Declare support for default styles - WordPress Tutorial

From the course: WordPress Content Blocks: Working with Themes

Start my 1-month free trial

Declare support for default styles

- [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…

Contents