# Customizer Example for Adding new section with a simple color selector

**URL:** https://discourse.roots.io/t/customizer-example-for-adding-new-section-with-a-simple-color-selector/14218
**Category:** sage
**Created:** 2018-11-25T23:02:06Z
**Posts:** 4

## Post 1 by @selim_koc — 2018-11-25T23:02:06Z

Hello  
I could not find an example of adding a new section with a new setting for theme customization on admin.php file. This is my admin.php file and it does not add anything to theme customization section.

```
<?php

namespace App;

/**
 * Theme customizer
 */
add_action('customize_register', function (\WP_Customize_Manager $wp_customize) {

  $wp_customize->add_section( 'mytheme_new_section_name' , array(
  'title' => __( 'CodersClan Button', 'mytheme' ),
  'priority' => 30,
  ) );

  $wp_customize->add_control( new \WP_Customize_Image_Control($wp_customize, 'image_control', array(
    'label' => __('Upload Your Main Logo', 'code_label'),
    'section' => 'sage_new_section_name',
    'mime_type' => 'image',
)));

$wp_customize->add_setting( 'header_textcolor' , array(
'default' => '#000000',
'transport' => 'refresh',
) );
$wp_customize->add_setting( 'header_color' , array(
'default' => '#000000',
'transport' => 'refresh',
) );

// Add postMessage support
$wp_customize->get_setting('blogname')->transport = 'postMessage';
$wp_customize->selective_refresh->add_partial('blogname', [
    'selector' => '.brand',
    'render_callback' => function () {
        bloginfo('name');
    }
]);
});

/**
 * Customizer JS
 */
add_action('customize_preview_init', function () {
wp_enqueue_script('sage/customizer.js', asset_path('scripts/customizer.js'), ['customize-preview'], null, true);
});
```

---

## Post 2 by @ben — 2018-11-27T01:28:29Z

I haven’t tried debugging your code, but FWIW there’s a simple example of utilizing the WP customizer [in the Sage book](https://roots.io/books/theme-development-with-sage/)

---

## Post 3 by @selim_koc — 2018-12-02T19:09:18Z

Thanks for the answer. I needed customization for a task for a job application test. I already submit my test with short-code & custom attributes instead of customizer.

---

## Post 4 by @system — 2019-01-06T23:02:10Z

This topic was automatically closed after 42 days. New replies are no longer allowed.
