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 - WordPress Tutorial
From the course: WordPress Content Blocks: Working with Themes
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
-
-
-
-
(Locked)
Add support for wide alignments2m 32s
-
(Locked)
Add styles for wide alignments5m 48s
-
(Locked)
Add support for theme-specific colors3m 16s
-
(Locked)
Add styles for theme-specific colors3m 43s
-
(Locked)
Disable custom color option55s
-
(Locked)
Add support for font sizes2m 25s
-
(Locked)
Add styles for font sizes2m 46s
-
(Locked)
Disable custom font sizes1m 7s
-
(Locked)
Add support for responsive embeds3m 16s
-
(Locked)
-
-