␡
- How Does the Theme Customizer Work?
- Adding Customizer Support to Your Theme
- Setting Up Sections, Settings, and Controls
- Enabling the Front End
- Testing It All Out
- That's It, You're Done!
Like this article? We recommend
Adding Customizer Support to Your Theme
Adding Customizer Support to Your Theme
Roll up your shirt sleeves; this bit requires some code! Don't worry; it's mainly just cut-and-paste. You'll need access to your functions.php and header.php files.
- Log into your WordPress Dashboard and choose Appearance > Editor.
- In the Templates list on the right side of your screen, click Theme Functions (see Figure 3).
- Add the following code before the closing ?> tag in your functions.php file, using the name of your theme in place of THEMENAME:
add_action( 'customize_register', 'THEMENAME_customize_register' ); function THEMENAME_customize_register($wp_customize) {
Figure 3 When you open the Editor, it will automatically display the style.css file. Choose Theme Functions from the file list on the right to edit your functions.php file.