Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #108342
    shahid864
    Participant

    hello,
    how we can move the new added area in customizer from parent theme to child theme so when update to latest version not loose modification, pls guide. thanks

    #108419
    Mahesh
    Participant

    @shahid84: You can add the additional option to the customizer via child theme as below. Add the following codes in your child theme’s functions.php file.

    function clean_business_child_customize_register( $wp_customize )
    {   
        $wp_customize->add_section( 'my_section', array(
            'description'   => esc_html__( 'This Is My Custom Section', 'clean-business-pro' ),
            'priority'      => 105,
            'title'         => esc_html__( 'My Section', 'clean-business-pro' ),
        ) );
    
        $wp_customize->add_setting( 'some_field', array(
            'capability'        => 'edit_theme_options',
            'sanitize_callback' => 'sanitize_text_field'
        ) );
    
        $wp_customize->add_control( 'some_field', array(
            'label'  => esc_html__( 'Some Text Field', 'clean-business-pro' ),
            'section' => 'my_section',
            'settings' => 'some_field',
            'type'   => 'text',
        ) );
    }
    add_action( 'customize_register', 'clean_business_child_customize_register' );

    If you are not familiar with this or coding, I recommend you to hire a customizer.

    Regards,
    Mahesh

    #109922
    shahid864
    Participant

    Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Clean Business pro child theme add new area in customizer’ is closed to new replies.