get_section('colors')->description = __('Background may only be visible on wide screens.', 'wk'); $wp_customize->get_section('background_image')->description = __('Background Pattern may only be visible on wide screens.', 'wk'); // Add the content settings (layout) $wp_customize->add_section('layout_settings', array( 'title' => __('Site Settings', 'wk'), 'description' => sprintf(__('Choose the layout of your blog', 'wk') ), 'priority' => 130, )); // Add the featured content layout setting and control. $wp_customize->add_setting('content_layout', array( 'default' => 'left', 'sanitize_callback' => 'wk_sanitize_layout', )); $wp_customize->add_control('content_layout', array( 'label' => __('Layout', 'wk'), 'section' => 'layout_settings', 'type' => 'select', 'choices' => array( 'left' => __('Left Sidebar', 'wk'), 'right' => __('Right Sidebar', 'wk'), 'None' => __('No Sidebar', 'wk'), ), )); // Add the featured content layout setting and control. $wp_customize->add_setting('facebook_url', array( 'default' => 'http://www.facebook.com', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('facebook_url', array( 'label' => __('Facebook Page', 'wk'), 'section' => 'layout_settings', 'type' => 'text' )); $wp_customize->add_setting('twitter_url', array( 'default' => 'http://twitter.com', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('twitter_url', array( 'label' => __('Twitter Profile', 'wk'), 'section' => 'layout_settings', 'type' => 'text' )); $wp_customize->add_setting('pinterest_url', array( 'default' => 'http://pinterest.com', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('pinterest_url', array( 'label' => __('Pinterest Profile', 'wk'), 'section' => 'layout_settings', 'type' => 'text' )); $wp_customize->add_setting('google_url', array( 'default' => 'http://www.google.com', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('google_url', array( 'label' => __('Google+ Page', 'wk'), 'section' => 'layout_settings', 'type' => 'text' )); $wp_customize->add_setting( 'header_image', array( 'default' => null, 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'header_image', array( 'label' => __( 'Header Background Image', 'wk' ), 'section' => 'layout_settings', 'settings' => 'header_image', ) ) ); } add_action('customize_register', 'wk_customize_register'); /** * Sanitize the Content layout value. */ function wk_sanitize_layout($layout) { if (!in_array($layout, array('left', 'right', 'None'))) { $layout = 'left'; } return $layout; }