Theme Customizer Default Sections

Posted

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 thoughts on “Theme Customizer Default Sections

  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 ;-)

    • Dario Novoa wrote:

      @Kattagami

      Thanks you so much!!!! for the remove_section.

  2. sin wrote:

    Thanks, this is a time saver! Btw, made any progress with Options Framework theme and customizer?

    Regards,
    Sinisa

  3. Pingback: Remove a section from WordPress Theme Customizer | Dario Novoa

  4. 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.

  5. Native Imaging wrote:

    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.

  6. Daniel wrote:

    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.

  7. Pingback: How to customize the WordPress theme customizer defaults : Post Status

  8. Peter wrote:

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

    Regards,
    Peter

    • Devin wrote:

      The static_front_page section?

Leave a Reply

Your email address will not be published. Required fields are marked *

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>