After a quick and easy installation you can add your first option.
You can access Customizer either from the front-end using the top admin bar or via Appearance -> Themes. Next to the active theme there is a Customize button; non-active themes have Live-Preview option.
Add Section allows us to add a new panel to the Customizer sidebar. WordPress doesn’t allow empty sections so while creating a section we need to provide information on the first control as well.
Add Control can be used to extend default sections and add theme-/plugin-specific options to the Customizer sidebar.
The following options are required to configure a new control:
ID – this is the option’s ID. If Customizer has been configured to access serialized options then only the option name should be provided.
Example: if a theme is storing options in
my_option should be provided in this field.
my_plugin_options is being pulled from Customizer’s configuration screen.
Label – label that will be displayed above the field.
Example: In the default WordPress section Navigation there is a label Primary Menu.
- text – standard input field
- checkbox – tick
- color – #RGB
- image – uses default WordPress media uploader
Values for radio/select input type
Radio and select boxes currently require following syntax:
value:label, value:label, value:label
If label and value are the same you can simply input:
value, value, value
You can also mix the methods above:
value:label, value, value:label
If you want to keep your options separate from the sections created by default you can add a new section to the side panel. A section requires at least one Control inside, otherwise it will not be displayed.
ID – section needs to have a unique ID. Adding another section with the same ID will overwrite the previous one.
Title – section’s label – what visitors will see
Description – additional information displayed when the mouse pointer is hovered over the seciton title (see default section Navigation or Static Front Page)
Priority – where your section will be displayed
The default sections have the following prioroty values:
|Site Title & Tagline||5|
|Static Front Page||50|
First Control Item – first item is required
Example of a section created with the plugin:
Drop a line in comments below if you have questions or suggestions.
If you want to learn more about setting up options and how Sections and Controls work start with the articles below: