WordPress theme customizer – can’t add section/settings

I’m trying to modify the Worpdress theme customizer by adding sections and settings but no matter what I add in my functions.php file, nothing ever shows up in the customizer.

Example:

Read More
function starter_customize_register( $wp_customize ) 
{
    $wp_customize->add_section( 'mytheme_new_section_name' , array(
    'title'      => __( 'Visible Section Name', 'starter' ),
    'priority'   => 30, ) );    
}
add_action( 'customize_register', 'starter_customize_register');

I would have expected this to add a section with the chosen name but the only things I see are the two initial sections from WordPress (site title & tagline, static front page).

I had found a pretty nice tutorial here (http://code.tutsplus.com/series/a-guide-to-the-wordpress-theme-customizer–wp-33722). I followed every step and even took their example theme but there again, no new sections or settings are displayed.

Makes me wonder if something is wrong with my configuration.

I’m using a wordpress network/multisite, don’t know if that’s relevant.

Any idea?

Thanks
Laurent

Related posts

Leave a Reply

1 comment

  1. You need to add setting(s) and control(s) to make it work:

    function starter_customize_register( $wp_customize ) 
    {
        $wp_customize->add_section( 'starter_new_section_name' , array(
            'title'    => __( 'Visible Section Name', 'starter' ),
            'priority' => 30
        ) );   
    
        $wp_customize->add_setting( 'starter_new_setting_name' , array(
            'default'   => '#000000',
            'transport' => 'refresh',
        ) );
    
        $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color', array(
            'label'    => __( 'Header Color', 'starter' ),
            'section'  => 'starter_new_section_name',
            'settings' => 'starter_new_setting_name',
        ) ) );
    }
    add_action( 'customize_register', 'starter_customize_register');
    

    Reference: Theme Customization API.