From the course: WordPress Content Blocks: Working with Themes

Unlock the full course today

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

Add support for font sizes

Add support for font sizes - WordPress Tutorial

From the course: WordPress Content Blocks: Working with Themes

Start my 1-month free trial

Add support for font sizes

- [Instructor] In addition to custom background and text color, the paragraph block allows the user to change the font size of each individual paragraph block. This is done using either the dropdown under text settings that you can set to any of the predefined sizes or by using this setting here where you can set a numerical value for the size you want. As a theme developer, it's a good idea to control what sizes are available from this dropdown so you get sizes that match up with the overall design of the theme. That's done by declaring theme support for editor font sizes. And here you'll start seeing a pattern emerging. You'll remember previously in the course, we added support for custom color palette and we created an array of arrays that has each of the colors defined while the exact same thing is happening down here in add theme support editor font sizes. It's an array of arrays and inside each of the individual sizes we declare a name. So this is the human readable name that's…

Contents