0

Is it possible to add controls to sub panels of the widgets panel in the customizer? If yes, how do I address them? The widget area would be named “top-widget-area”

Neither addressing:

'panel' => 'widgets-top-widget-area'

nor

'section' => 'widgets-top-widget-area'

in $wp_customize->add_control work.

Do you have an idea?

  • Needing some clarification: You're wanting to add controls to the panel that lists the sidebar areas? Or you mean the panel before that? – Jami Gibbs Dec 28 '16 at 22:08
  • Hi @jami0821, Directly into the panel for a specific widget area. For example I want to add a control to the bespoken "top-widget-area" to define how many columns it should have. – richwp Dec 29 '16 at 8:34
  • WP-Admin » Customizer » Widgets Panel » Top Widget Area – richwp Dec 29 '16 at 8:37
0

Turns out the section would be addressed with 'section' => 'sidebar-widgets-top-widget-area' ... so you need the sidebar-widgets- in front of the widget area name.

However, since it is the widgets panel, everything except the widget areas active on the page your are at are set to display: none; and need to be set to: display: block !important;

0

@richwp , I asked a similar question and got a detailed answer from Weston Ruter, who actually works on the Widgets customizer panel in core. He created a writeup, a video, and a github repo with source code in order to answer my question (which was an awesome thing to do). Here is the link to the writeup he did: [link]https://make.xwp.co/2017/02/08/adding-meta-fields-to-a-widget-sidebar-section-in-the-customizer/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.