Theme Customizer Default Sections

I kept having to hunt through wp-includes/class-wp-customize-manager.php to see what the default sections in the theme customizer were registered as.

To save you the trouble, here they are:

title_tagline

$this->add_section( 'title_tagline', array(
     'title'    => __( 'Site Title & Tagline' ),
     'priority' => 20,
) );

colors

$this->add_section( 'colors', array(
     'title'          => __( 'Colors' ),
     'priority'       => 40,
) );

header_image

$this->add_section( 'header_image', array(
     'title'          => __( 'Header Image' ),
     'theme_supports' => 'custom-header',
     'priority'       => 60,
) );

background_image

$this->add_section( 'background_image', array(
     'title'          => __( 'Background Image' ),
     'theme_supports' => 'custom-background',
     'priority'       => 80,
) );

nav

$this->add_section( 'nav', array(
     'title'          => __( 'Navigation' ),
     'theme_supports' => 'menus',
     'priority'       => 100,
     'description'    => sprintf( _n('Your theme supports %s menu. Select which menu you would like to use.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) ) . "\n\n" . __('You can edit your menu content on the Menus screen in the Appearance section.'),
) );

static_front_page

$this->add_section( 'static_front_page', array(
     'title'          => __( 'Static Front Page' ),
      // 'theme_supports' => 'static-front-page',
      'priority'       => 120,
      'description'    => __( 'Your theme supports a static front page.' ),
) );

If you’re not sure how to add options to these default sections, give Otto’s post a read.

About Devin

I'm a WordPress developer based in Austin, Texas. Follow my projects on GitHub, or more general WordPress ramblings as @devinsays on twitter.

13 Responses

  1. Thanks Devin for these snippets, very useful.

    To removing one of these options (ie: Title & Tagline) from the customize back-end, just put …

    $wp_customize->remove_section( 'title_tagline');
    

    … in your functions.php file.

    I will try to use WP Customize and Theme options ;-)

  2. A very useful list, thanks for posting it Devin.

    I wanted to rename Header Image section to Logo, surprisingly just re-adding it from functions.php, with a different name, worked fine:


    // Renaming "Header Image" section to "Logo"
    $wp_customize->add_section( 'header_image', array(
    'title' => __( 'Logo' ),
    'theme_supports' => 'custom-header',
    'priority' => 60,
    ) );

    Still not sure if there are any downsides to doing it like this, but no errors or notices.

  3. Native Imaging

    I notice to options that I haven’t seen before, but they don’t seem to work or i don’t understand how they work>

    'theme_supports' =>

    &

    'description' => sprintf( _n('Your theme supports %s menu. Select which menu you would like to use.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) ) . "\n\n" . __('You can edit your menu content on the Menus screen in the Appearance section.'),

    I’m a bit confused about what ‘theme_supports’ does, and the ‘description’ option doesn’t seem to do anything.. Do I need to ‘extend’ the control to get the description to work?

    Thanks for this post. Once I have my theme customizer finished, I will post the code on Github.

  4. This is nice, but how do I disable the entire customization thing completely from WordPress? Everyone shows how to set up your theme for customization, but no one how to disable the feature. If you know, please help! Thanks.

      1. Yeah… Thanks, but this is still not answering my question. I want to disable customization completely, not just for a section or two.

  5. Peter

    Hi,
    Hmm… how add default section from WordPress Theme Customizer for editors? Ex. static_front_page – Static Front Page…

    Regards,
    Peter

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>