Hi there, I am trying to add settings to the WP customizer, I have tried to add panels, sections, etc… and none of them appear. These are the only settings that show up:
My customizer function is based off of some sample code:
function customize_register($wp_customize) {
$wp_customize->get_setting('blogname')->transport = 'postMessage';
/*
* Failsafe is safe
*/
if ( ! isset( $wp_customize ) ) {
return;
}
echo get_theme_mod('widget_list_style');
/**
* Add Panel for General Settings.
*
* @uses $wp_customize->add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
* @link $wp_customize->add_panel() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_panel
*/
$wp_customize->add_panel(
// $id
'theme_slug_panel_general',
// $args
array(
'priority' => 10,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Theme Name General Settings', 'theme-slug' ),
'description' => __( 'Configure general settings for the Theme Name Theme', 'theme-slug' ),
)
);
/**
* Add Panel for Color and Layout Settings.
*
* @uses $wp_customize->add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
* @link $wp_customize->add_panel() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_panel
*/
$wp_customize->add_panel(
// $id
'theme_slug_panel_colorslayouts',
// $args
array(
'priority' => 11,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Theme Name Colors and Layouts', 'theme-slug' ),
'description' => __( 'Configure color and layout settings for the Theme Name Theme', 'theme-slug' ),
)
);
/**
* Add Panel for Advanced Settings.
*
* @uses $wp_customize->add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
* @link $wp_customize->add_panel() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_panel
*/
$wp_customize->add_panel(
// $id
'theme_slug_panel_advanced',
// $args
array(
'priority' => 12,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Theme Name Advanced Settings', 'theme-slug' ),
'description' => __( 'Configure advanced settings for the Theme Name Theme', 'theme-slug' ),
)
);
}
add_action('customize_register', __NAMESPACE__ . '\\customize_register');