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.

Disable custom color option

Disable custom color option - WordPress Tutorial

From the course: WordPress Content Blocks: Working with Themes

Start my 1-month free trial

Disable custom color option

- [Instructor] On the topic of custom colors, for some themes you may want to disable this custom color option so users can only apply colors from the custom color palette you've declared. You can disable this custom color option with a single line of code. It looks like this and I'll add it directly before enable custom color palette. Add theme support. Disable custom colors. Now this name, disable custom colors, is a bit misleading because it sounds like you're disabling custom colors altogether. What you're actually doing is just disabling the custom colors that WordPress itself provides. When we add it together with the color palette, you'll see that we keep the color palette, we just take away that option for the custom color that you can select from the entire color wheel. So this restricts the user to only using the defined colors for this particular theme.

Contents