最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

theme customizer - site identity section name?

programmeradmin1浏览0评论

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.

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.

Share Improve this question asked Sep 17, 2017 at 19:51 WordCentWordCent 1,8916 gold badges34 silver badges60 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 6

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 ).

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

发布评论

评论列表(0)

  1. 暂无评论