I am currently developing a Wordpress Theme, using the Theme Customizer to let users customize it, but I have got stuck.
For the footer, I have created various widgets, containing different things like Recent Posts, or a Live Twitter Feed.
I want the users to be able to organize them, in the order they want, yet I cannot work out how to do it. I found one other theme (Zerif Lite), that lets you do this (see image below), however I went through all the code and couldn't work out they did it, there was nothing adding the 'Our focus section widgets' section.
I have organized my theme similarly, there are various Panels, with Sections, and I want one of those sections to contain it.
EDIT:
Not everyone seems to get my problem. I KNOW how to create Widgets
I know how to create Widgets. I want an area in the Theme Customizer for users to move them around, not just the ones I created, but also other default ones like the Tag Cloud.
EDIT 2: @Codeartist, I am using Wordpress 4.3.1, and here is my code in functions.php
function widgets_init_mysite() {
register_sidebar( array(
'name' => __( 'Main Sidebar', 'twentyeleven' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'widgets_init_mysite' );
function mytheme_customizer( $wp_customize ) {
$wp_customize->add_panel( 'panel_for_widgets', array(
'priority' => 70,
'title' => __('Panel for widgets', 'codeartist'),
'capability' => 'edit_theme_options',
));
$wp_customize->get_section( 'sidebar-widgets-sidebar-1' )->panel = 'panel_for_widgets';
}
add_action( 'customize_register', 'mytheme_customizer' );