Question

In the customizer, the site identity section is missing a logo upload field. Adding such field is not a big deal: A field can be added, but I don't know the section name that is created in the core of the WordPress. Can someone help me in that?

The field can be created like this:

    $fields[] = array(
    'type'        => 'color',
    'setting'     => 'links_color',
    'label'       => __( 'Links Color', 'twentytwelve' ),
    'section'     => 'header',
    'default'     => '#00A2E8',
    'priority'    => 10,
    'output'      => array(
        'element'  => 'body #page a, body #page a:link, body #page a:visited, body #page a:hover',
        'property' => 'color',
    )
);

The below is a section for the header:

'section'     => 'header',

I want to know the section name of the site identity so that the logo option can be added there.enter image description here

Était-ce utile?

La solution

The “Site Identity” section has the ID of title_tagline for historical reasons.

If you want to see the IDs for the core sections, all you have to do is look at the source for WP_Customize_Manager::register_controls(). Alternatively, you can get a list of all the sections registered, whether by core or by plugins, by opening your console and entering: _.keys( wp.customize.settings.sections ).

Autres conseils

For anyone in the future searching for the already defined section name, have a look at this official link from wordpress documentation.

Licencié sous: CC-BY-SA avec attribution
Non affilié à wordpress.stackexchange
scroll top