alexohneander
alexohneander

Reputation: 559

How to add custom fields to customize menu in Wordpress

I want to add some custom menu points to the customize menu. So the user is able to edit the page much easier.

enter image description here

Upvotes: 0

Views: 1420

Answers (1)

Ajay Kumar
Ajay Kumar

Reputation: 1342

In your theme go to the function.php

and Code like this

function self_customizer_section($wp_customize) {
    $wp_customize->add_section( 'section_name' , array(
        'title'       => __( 'Self Logo', 'my_theme' ),
        'description' => 'theme general options',
    ));

    /* LOGO */
    $wp_customize->add_setting( 'self_logo', array(
        'default' => get_template_directory_uri().'/images/mytheme.png'
    ));

    $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'self_logo', array(
        'label'    => __( 'Main Logo', 'my_theme' ),
        'section'  => 'section_name',
        'settings' => 'self_logo',
    )));
}

add_action('customize_register', 'self_customizer_section');

For more detail you can follow the below link he made the awesome tutorial on that question

See in continuation.

here is the link

Wordpress Theme Customization API Tutorial

Upvotes: 1

Related Questions