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.

Disable custom font sizes

Disable custom font sizes - WordPress Tutorial

From the course: WordPress Content Blocks: Working with Themes

Start my 1-month free trial

Disable custom font sizes

- [Instructor] Speaking of the font sizes, out of the box, a user can go into any paragraph block and use the toggle here on the right hand side to set any font size they want. Now there's a good chance as a theme developer you may want to disable this option, because you only want the user to be able to use specific predefined font sizes that look good and work properly within the theme. If so, you can disable this custom feature here. That's done with a single line of code. I'll add it directly before custom font sizes. I'll say Disable custom font sizing. And then we say add_theme_support('disable-custom-sizes'); and just like with the colors this is a bit of a deceptive name, because it sounds like you're disabling custom font sizes all together. What you're actually doing is disabling the toggle that allows the user to customize the font size to whatever they want. So once you've added that feature, what's left for the user is to use the dropdown here with the font sizes you've…

Contents