get_section( 'colors' )->description = __( 'Background may only be visible on wide screens.', 'boron' ); $wp_customize->get_section( 'background_image' )->description = __( 'Background may only be visible on wide screens.', 'boron' ); // Add postMessage support for site title and description. $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; // Rename the label to "Site Title Color" because this only affects the site title in this theme. $wp_customize->get_control( 'header_textcolor' )->label = __( 'Site Title Color', 'boron' ); // Rename the label to "Display Site Title & Tagline" in order to make this option extra clear. $wp_customize->get_control( 'display_header_text' )->label = __( 'Display Site Title & Tagline', 'boron' ); // $wp_customize->get_section( 'header_image' )->title = __( 'Side navigation logo', 'boron' ); // Add General setting panel and configure settings inside it $wp_customize->add_panel( 'boron_general_panel', array( 'priority' => 250, 'capability' => 'edit_theme_options', 'title' => __( 'General settings' , 'boron'), 'description' => __( 'You can configure your general theme settings here' , 'boron') ) ); // Add navigation setting panel and configure settings inside it $wp_customize->add_panel( 'boron_navigation_panel', array( 'priority' => 250, 'capability' => 'edit_theme_options', 'title' => __( 'Side navigation settings' , 'boron'), 'description' => __( 'You can configure your theme side navigation settings here.' , 'boron') ) ); // Scroll to top $wp_customize->add_section( 'boron_general_scrolltotop', array( 'priority' => 30, 'capability' => 'edit_theme_options', 'title' => __( 'Scroll to top' , 'boron'), 'description' => __( 'Do you want to enable "Scroll to Top" button?' , 'boron'), 'panel' => 'boron_general_panel' ) ); $wp_customize->add_setting( 'boron_scrolltotop', array( 'sanitize_callback' => 'boron_sanitize_checkbox' ) ); $wp_customize->add_control( 'boron_scrolltotop', array( 'label' => __( 'Scroll to top', 'boron' ), 'section' => 'boron_general_scrolltotop', 'type' => 'checkbox', ) ); // Post background $wp_customize->add_section( 'boron_post_bg', array( 'priority' => 50, 'capability' => 'edit_theme_options', 'title' => __( 'Post background' , 'boron'), 'description' => __( 'Do you want your own post background? You can change it here.' , 'boron'), 'panel' => 'boron_general_panel' ) ); $wp_customize->add_setting( 'boron_post_background', array( 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'boron_post_background', array( 'label' => __( 'Post background', 'boron' ), 'section' => 'boron_post_bg', 'settings' => 'boron_post_background', ) ) ); // Comment position $wp_customize->add_section( 'boron_post_comments', array( 'priority' => 60, 'capability' => 'edit_theme_options', 'title' => __( 'Post comments' , 'boron'), 'description' => __( 'Choose where to show post comments.' , 'boron'), 'panel' => 'boron_general_panel' ) ); $wp_customize->add_setting( 'boron_comment_location', array( 'default' => 'side', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'boron_comment_location', array( 'label' => __( 'Post comments position', 'boron' ), 'section' => 'boron_post_comments', 'type' => 'select', 'choices' => array( 'side' => 'Right side', 'bottom' => 'After post content' ) ) ); // Grid size $wp_customize->add_section( 'boron_grid_size', array( 'priority' => 60, 'capability' => 'edit_theme_options', 'title' => __( 'Post grid size' , 'boron'), 'description' => __( 'Choose how many columns will there be at the post grid.' , 'boron'), 'panel' => 'boron_general_panel' ) ); $wp_customize->add_setting( 'boron_grid_columns', array( 'default' => '4', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'boron_grid_columns', array( 'label' => __( 'Post grid size', 'boron' ), 'section' => 'boron_grid_size', 'type' => 'select', 'choices' => array( '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6' ) ) ); // Background $wp_customize->add_section( 'boron_navigation_bg', array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __( 'Navigation background' , 'boron'), 'description' => __( 'Do you want your own navigation background? You can change it here.' , 'boron'), 'panel' => 'boron_navigation_panel' ) ); $wp_customize->add_setting( 'boron_navigation_background', array( 'sanitize_callback' => 'esc_url_raw', 'default' => get_template_directory_uri() . '/images/navigation-bg.png' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'boron_navigation_background', array( 'label' => __( 'Navigation background', 'boron' ), 'section' => 'boron_navigation_bg', 'settings' => 'boron_navigation_background', ) ) ); // Navigation title $wp_customize->add_section( 'boron_navigation_title', array( 'priority' => 30, 'capability' => 'edit_theme_options', 'title' => __( 'Navigation title' , 'boron'), 'description' => __( 'Title for the side navigation.' , 'boron'), 'panel' => 'boron_navigation_panel' ) ); $wp_customize->add_setting( 'boron_nav_title', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'boron_nav_title', array( 'label' => __( 'Navigation title', 'boron' ), 'section' => 'boron_navigation_title', 'type' => 'text', ) ); // Navigation description $wp_customize->add_section( 'boron_navigation_description', array( 'priority' => 40, 'capability' => 'edit_theme_options', 'title' => __( 'Navigation description' , 'boron'), 'description' => __( 'Description for the side navigation.' , 'boron'), 'panel' => 'boron_navigation_panel' ) ); $wp_customize->add_setting( 'boron_nav_description', array( 'sanitize_callback' => 'boron_sanitize_textarea' ) ); $wp_customize->add_control( 'boron_nav_description', array( 'label' => __( 'Navigation description', 'boron' ), 'section' => 'boron_navigation_description', 'type' => 'textarea', ) ); // Button #1 $wp_customize->add_section( 'boron_navigation_button1', array( 'priority' => 50, 'capability' => 'edit_theme_options', 'title' => __( 'Button #1' , 'boron'), 'description' => __( 'Settings for your button.' , 'boron'), 'panel' => 'boron_navigation_panel' ) ); $wp_customize->add_setting( 'boron_nav_button1_text', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'boron_nav_button1_text', array( 'label' => __( 'Button #1 text', 'boron' ), 'section' => 'boron_navigation_button1', 'type' => 'text', ) ); $wp_customize->add_setting( 'boron_nav_button1_link', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'boron_nav_button1_link', array( 'label' => __( 'Button #1 link', 'boron' ), 'section' => 'boron_navigation_button1', 'type' => 'text', ) ); // Button #2 $wp_customize->add_section( 'boron_navigation_button2', array( 'priority' => 60, 'capability' => 'edit_theme_options', 'title' => __( 'Button #2' , 'boron'), 'description' => __( 'Settings for your button.' , 'boron'), 'panel' => 'boron_navigation_panel' ) ); $wp_customize->add_setting( 'boron_nav_button2_text', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'boron_nav_button2_text', array( 'label' => __( 'Button #2 text', 'boron' ), 'section' => 'boron_navigation_button2', 'type' => 'text', ) ); $wp_customize->add_setting( 'boron_nav_button2_link', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'boron_nav_button2_link', array( 'label' => __( 'Button #2 link', 'boron' ), 'section' => 'boron_navigation_button2', 'type' => 'text', ) ); // Button #3 $wp_customize->add_section( 'boron_navigation_button3', array( 'priority' => 70, 'capability' => 'edit_theme_options', 'title' => __( 'Button #3' , 'boron'), 'description' => __( 'Settings for your button.' , 'boron'), 'panel' => 'boron_navigation_panel' ) ); $wp_customize->add_setting( 'boron_nav_button3_text', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'boron_nav_button3_text', array( 'label' => __( 'Button #3 text', 'boron' ), 'section' => 'boron_navigation_button3', 'type' => 'text', ) ); $wp_customize->add_setting( 'boron_nav_button3_link', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'boron_nav_button3_link', array( 'label' => __( 'Button #3 link', 'boron' ), 'section' => 'boron_navigation_button3', 'type' => 'text', ) ); // Button #4 $wp_customize->add_section( 'boron_navigation_button4', array( 'priority' => 80, 'capability' => 'edit_theme_options', 'title' => __( 'Button #4' , 'boron'), 'description' => __( 'Settings for your button.' , 'boron'), 'panel' => 'boron_navigation_panel' ) ); $wp_customize->add_setting( 'boron_nav_button4_text', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'boron_nav_button4_text', array( 'label' => __( 'Button #4 text', 'boron' ), 'section' => 'boron_navigation_button4', 'type' => 'text', ) ); $wp_customize->add_setting( 'boron_nav_button4_link', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'boron_nav_button4_link', array( 'label' => __( 'Button #4 link', 'boron' ), 'section' => 'boron_navigation_button4', 'type' => 'text', ) ); // Social links $wp_customize->add_section( new boron_Customized_Section( $wp_customize, 'boron_social_links', array( 'priority' => 300, 'capability' => 'edit_theme_options' ) ) ); $wp_customize->add_setting( 'boron_fake_field', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'boron_fake_field', array( 'label' => '', 'section' => 'boron_social_links', 'type' => 'text' ) ); } add_action( 'customize_register', 'boron_customize_register' ); if ( class_exists( 'WP_Customize_Section' ) && !class_exists( 'boron_Customized_Section' ) ) { class boron_Customized_Section extends WP_Customize_Section { public function render() { $classes = 'accordion-section control-section control-section-' . $this->type; ?>