get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; } } add_action( 'customize_register', 'bootredux_customize_register' ); if ( ! function_exists( 'bootredux_theme_customize_register' ) ) { /** * Register individual settings through customizer's API. * * @param WP_Customize_Manager $wp_customize Customizer reference. */ function bootredux_theme_customize_register( $wp_customize ) { $bootredux_image_path_url = get_template_directory_uri().'/images/'; /* Pro Features */ $wp_customize->add_section( 'bootredux_theme_pro_info', array( 'title' => __( 'Bootredux PRO Version', 'bootredux' ), 'priority' => 1, ) ); $wp_customize->add_setting( 'bootredux_pro_info', array( 'sanitize_callback' => 'esc_html', ) ); /* * View Pro Version Section Control */ $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_pro_info', array( 'section' => 'bootredux_theme_pro_info', 'priority' => 100, 'description' => __( '
Access more features and functionalities for a better blog/website. Support the development of the Bootredux theme with a small payment and upgrade to full features.
', 'bootredux' ), 'choices' => array( __('Multiple content block layouts','bootredux'), __('Extra color options','bootredux'), __('Aqua Resizer for Thumbnails','bootredux'), ), 'type' => 'radio', ) ) ); // Theme layout settings. $wp_customize->add_section( 'bootredux_theme_layout_options', array( 'title' => __( 'Theme Layout', 'bootredux' ), 'capability' => 'edit_theme_options', 'description' => __( 'Choose the default layout container width, sidebar position, etc.', 'bootredux' ), 'priority' => 20, ) ); $wp_customize->add_setting( 'bootredux_container_type', array( 'default' => 'container', 'type' => 'theme_mod', 'sanitize_callback' => 'esc_textarea', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'container_type', array( 'label' => __( 'Container Width', 'bootredux' ), 'description' => __( "Choose between Bootstrap's container and container-fluid layouts.", 'bootredux' ), 'section' => 'bootredux_theme_layout_options', 'settings' => 'bootredux_container_type', 'type' => 'select', 'choices' => array( 'container' => __( 'Fixed Width', 'bootredux' ), 'container-fluid' => __( 'Full Width', 'bootredux' ), ), 'priority' => '1', ) ) ); $wp_customize->add_setting( 'bootredux_sidebar_position', array( 'default' => 'right', 'type' => 'theme_mod', 'sanitize_callback' => 'esc_textarea', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_sidebar_position', array( 'label' => __( 'Sidebar Position', 'bootredux' ), 'description' => __( "Set sidebar's default position: right, left, both or none. You can override the setting on individual pages using templates.", 'bootredux' ), 'section' => 'bootredux_theme_layout_options', 'settings' => 'bootredux_sidebar_position', 'type' => 'select', 'choices' => array( 'right' => __( 'Right Sidebar', 'bootredux' ), 'left' => __( 'Left Sidebar', 'bootredux' ), 'both' => __( 'Left & Right Sidebars', 'bootredux' ), 'none' => __( 'No Sidebar', 'bootredux' ), ), ) ) ); $wp_customize->add_setting( 'bootredux_index_image', array( 'default' => 'right', 'type' => 'theme_mod', 'sanitize_callback' => 'esc_textarea', 'capability' => 'edit_theme_options', ) ); /* Get Array of Image Sizes & Create Select Choices Array using function get_image_sizes() in extra.php */ $bootredux_image_sizes = get_image_sizes(); $image_choices = array( 'none' => 'No Image', 'full' => 'Full Image'); foreach ($bootredux_image_sizes as $bootredux_image_name=>$bootredux_image_array) { $image_choices[$bootredux_image_name] = 'Image: '. $bootredux_image_name . ' (' . $bootredux_image_array['width'] . ' x ' . $bootredux_image_array['height'] .'Px)'; } $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_index_image', array( 'label' => __( 'Blog Index Image', 'bootredux' ), 'description' => __( "Set image size in index, archives pages. Define image sizes via the media settings. Recommended: medium_large / large", 'bootredux' ), 'section' => 'bootredux_theme_layout_options', 'settings' => 'bootredux_index_image', 'type' => 'select', 'choices' => $image_choices, ) ) ); $wp_customize->add_setting( 'bootredux_bootstrap_style', array( 'default' => 'default', 'type' => 'theme_mod', 'sanitize_callback' => 'esc_textarea', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootstrap_type', array( 'label' => __( 'Bootstrap Color Scheme', 'bootredux' ), 'description' => __( "Choose the Bootstrap CSS style. Default or custom color scheme.", 'bootredux' ), 'section' => 'bootredux_theme_layout_options', 'settings' => 'bootredux_bootstrap_style', 'type' => 'select', 'choices' => array( 'default' => __( 'Default', 'bootredux' ), 'red' => __( 'Red', 'bootredux' ), 'green' => __( 'Green', 'bootredux' ), 'blue' => __( 'Blue', 'bootredux' ), 'lumen' => __( 'Lumen Blue', 'bootredux' ), 'litera' => __( 'Litera Blue', 'bootredux' ), 'yeti' => __( 'Yeti Blue', 'bootredux' ), 'golden' => __( 'Golden', 'bootredux' ), 'united' => __( 'United Orange', 'bootredux' ), 'pink' => __( 'Pink', 'bootredux' ), 'purple' => __( 'Purple', 'bootredux' ), 'purple-alt' => __( 'Purple Alt', 'bootredux' ), 'pulse' => __( 'Pulse Purple', 'bootredux' ), 'sketchy' => __( 'Funky Sketchy', 'bootredux' ), 'dark' => __( 'Dark', 'bootredux' ), ), ) ) ); $wp_customize->add_setting( 'bootredux_colorscheme', array( 'default' => 'primary', 'type' => 'theme_mod', 'sanitize_callback' => 'esc_textarea', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'navbar_type', array( 'label' => __( 'Header & Footer Color Scheme', 'bootredux' ), 'description' => __( "Choose the color scheme for the website header & footer navigation bar.", 'bootredux' ), 'section' => 'bootredux_theme_layout_options', 'settings' => 'bootredux_colorscheme', 'type' => 'select', 'choices' => array( 'primary' => __( 'Primary Color', 'bootredux' ), 'dark' => __( 'Dark Grey', 'bootredux' ), 'light' => __( 'Light Grey', 'bootredux' ), 'info' => __( 'Info Blue', 'bootredux' ), 'warning' => __( 'Warning Yellow', 'bootredux' ), ), ) ) ); $wp_customize->add_setting( 'bootredux_typography', array( 'default' => 'default', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( new WP_Customize_Control($wp_customize, 'preset_style_setting', array( 'label' => __( 'Typography', 'bootredux' ), 'description' => __( "Choose from the pre-defined Google font combinations.", 'bootredux' ), 'section' => 'bootredux_theme_layout_options', 'settings' => 'bootredux_typography', 'type' => 'select', 'choices' => array( 'default' => 'Default', 'opensans-opensans' => 'Open Sans / Open Sans', 'bungee-abel' => 'Bungee / Abel', 'abel-abel' => 'Abel / Abel', 'acme-abel' => 'Acme / Abel', 'arbutusslab-opensans' => 'Arbutus Slab / Open Sans', 'montserrat-merriweather' => 'Montserrat / Merriweather', 'montserrat-opensans' => 'Montserrat / Open Sans', 'oswald-muli' => 'Oswald / Muli', 'poppins-lora' => 'Poppins / Lora', 'poppins-poppins' => 'Poppins / Poppins', 'roboto-roboto' => 'Roboto / Roboto', 'robotoslab-roboto' => 'Roboto Slab / Roboto', 'ubuntu-ubuntu' => 'Ubuntu / Ubuntu', ), ) ) ); $wp_customize->add_setting( 'bootredux_postinfo_author', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_postinfo_author', array( 'settings' => 'bootredux_postinfo_author', 'label' => __('Show author in single post info?', 'bootredux'), 'section' => 'bootredux_theme_layout_options', 'type' => 'checkbox', ) ) ); $wp_customize->add_setting( 'bootredux_postinfo_date', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_postinfo_date', array( 'settings' => 'bootredux_postinfo_date', 'label' => __('Show date in single post info?', 'bootredux'), 'section' => 'bootredux_theme_layout_options', 'type' => 'checkbox', ) ) ); $wp_customize->add_setting( 'bootredux_postinfo_category', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_postinfo_category', array( 'settings' => 'bootredux_postinfo_category', 'label' => __('Show category in single post info?', 'bootredux'), 'section' => 'bootredux_theme_layout_options', 'type' => 'checkbox', ) ) ); $wp_customize->add_setting( 'bootredux_indexinfo_author', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_indexinfo_author', array( 'settings' => 'bootredux_indexinfo_author', 'label' => __('Show author in blogpage post info?', 'bootredux'), 'section' => 'bootredux_theme_layout_options', 'type' => 'checkbox', ) ) ); $wp_customize->add_setting( 'bootredux_indexinfo_date', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_indexinfo_date', array( 'settings' => 'bootredux_indexinfo_date', 'label' => __('Show date in blogpage post info?', 'bootredux'), 'section' => 'bootredux_theme_layout_options', 'type' => 'checkbox', ) ) ); $wp_customize->add_setting( 'bootredux_indexinfo_category', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_indexinfo_category', array( 'settings' => 'bootredux_indexinfo_category', 'label' => __('Show category in blogpage post info?', 'bootredux'), 'section' => 'bootredux_theme_layout_options', 'type' => 'checkbox', ) ) ); /*Banner*/ $wp_customize->add_section( 'bootredux_header_banner', array( 'title' => __( 'Header Banner', 'bootredux' ), 'description' => __( 'Customize the static header banner for display on the website. For carousel/slider, use the Hero Slider sidebar widget area.', 'bootredux' ), 'priority' => 30, ) ); $wp_customize->add_setting('header_image', array( 'default' => '', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize,'header_image',array( 'label' => 'Header Image', 'section' => 'bootredux_header_banner', 'settings' => 'header_image', 'priority' => 1 ) ) ); $wp_customize->add_setting( 'bootredux_banner_bgcolor', array( 'default' => '#222222', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bootredux_bg_color', array( 'label' => __( 'Background Color', 'bootredux' ), 'section' => 'bootredux_header_banner', 'settings' => 'bootredux_banner_bgcolor', ) ) ); $wp_customize->add_setting( 'bootredux_banner_title', array( 'default' => '', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_banner_title_setting', array( 'label' => __( 'Banner Title', 'bootredux' ), 'section' => 'bootredux_header_banner', 'settings' => 'bootredux_banner_title', 'type' => 'text' ) ) ); $wp_customize->add_setting( 'bootredux_banner_tagline', array( 'default' => '', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_banner_tagline_setting', array( 'label' => __( 'Banner Tagline', 'bootredux' ), 'section' => 'bootredux_header_banner', 'settings' => 'bootredux_banner_tagline', 'type' => 'text' ) ) ); $wp_customize->add_setting( 'bootredux_banner_button1_text', array( 'default' => '', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_banner_button1_text', array( 'label' => __( 'Button #1 Text', 'bootredux' ), 'section' => 'bootredux_header_banner', 'settings' => 'bootredux_banner_button1_text', 'type' => 'text' ) ) ); $wp_customize->add_setting( 'bootredux_banner_button1_link', array( 'default' => '', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_banner_button1_link', array( 'label' => __( 'Button #1 Link', 'bootredux' ), 'section' => 'bootredux_header_banner', 'settings' => 'bootredux_banner_button1_link', 'type' => 'text' ) ) ); $wp_customize->add_setting( 'bootredux_banner_button1_style', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_textarea', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_banner_button1_style', array( 'label' => __( 'Button #1 Style', 'bootredux' ), 'section' => 'bootredux_header_banner', 'settings' => 'bootredux_banner_button1_style', 'type' => 'select', 'choices' => array( 'light' => 'Light', 'primary' => 'Primary', 'success' => 'Success', 'info' => 'Info', 'warning' => 'Warning', 'danger' => 'Danger', 'dark' => 'Dark', 'outline-light' => 'Outline Light', 'outline-primary' => 'Outline Primary', 'outline-success' => 'Outline Success', 'outline-info' => 'Outline Info', 'outline-warning' => 'Outline Warning', 'outline-danger' => 'Outline Danger', 'outline-dark' => 'Outline Dark', ), ) ) ); $wp_customize->add_setting( 'bootredux_banner_button2_text', array( 'default' => '', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_banner_button2_text', array( 'label' => __( 'Button #2 Text', 'bootredux' ), 'section' => 'bootredux_header_banner', 'settings' => 'bootredux_banner_button2_text', 'type' => 'text' ) ) ); $wp_customize->add_setting( 'bootredux_banner_button2_link', array( 'default' => '', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_banner_button2_link', array( 'label' => __( 'Button #2 Link', 'bootredux' ), 'section' => 'bootredux_header_banner', 'settings' => 'bootredux_banner_button2_link', 'type' => 'text' ) ) ); $wp_customize->add_setting( 'bootredux_banner_button2_style', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_textarea', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_banner_button2_style', array( 'label' => __( 'Button #2 Style', 'bootredux' ), 'section' => 'bootredux_header_banner', 'settings' => 'bootredux_banner_button2_style', 'type' => 'select', 'choices' => array( 'light' => 'Light', 'primary' => 'Primary', 'success' => 'Success', 'info' => 'Info', 'warning' => 'Warning', 'danger' => 'Danger', 'dark' => 'Dark', 'outline-light' => 'Outline Light', 'outline-primary' => 'Outline Primary', 'outline-success' => 'Outline Success', 'outline-info' => 'Outline Info', 'outline-warning' => 'Outline Warning', 'outline-danger' => 'Outline Danger', 'outline-dark' => 'Outline Dark', ), ) ) ); $wp_customize->add_setting( 'bootredux_banner_visibility', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_textarea', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootstrap_banner_visibility', array( 'label' => __( 'Banner Visibility', 'bootredux' ), 'description' => __( "Choose the locations to show the header banner.", 'bootredux' ), 'section' => 'bootredux_header_banner', 'settings' => 'bootredux_banner_visibility', 'type' => 'select', 'choices' => array( 'none' => __( 'None', 'bootredux' ), 'home' => __( 'Default Home Page / Front Page Only', 'bootredux' ), 'blogpage' => __( 'Blog Home Page Only', 'bootredux' ), 'posts' => __( 'Posts Only', 'bootredux' ), 'all' => __( 'Everywhere', 'bootredux' ), ), ) ) ); //Site Name Text Color $wp_customize->add_section( 'bootredux_site_colors', array( 'title' => __( 'Colors', 'bootredux' ), 'priority' => 40, ) ); $wp_customize->add_section( 'colors', array( 'title' => __( 'Background Color', 'bootredux' ), 'priority' => 50, 'panel' => 'styling_option_panel', ) ); $wp_customize->add_setting( 'bootredux_browser_color', array( 'default' => '#222222', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bootredux_browser_color', array( 'label' => __( 'Browser Color', 'bootredux' ), 'description' => __( 'Set the browser header color, visible on smartphone web browsers.', 'bootredux' ), 'section' => 'bootredux_site_colors', 'settings' => 'bootredux_browser_color', ) ) ); //Header Footer Codes $wp_customize->add_section( 'bootredux_insert_codes', array( 'title' => __( 'Custom Scripts', 'bootredux' ), 'priority' => 60, ) ); $wp_customize->add_setting( 'bootredux_header_code', array( 'default' => '', 'sanitize_callback' => 'esc_attr', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_header_code', array( 'label' => __( 'Header Code', 'bootredux' ), 'description' => __( 'Insert codes to be added before the closing </head> tag.', 'bootredux' ), 'section' => 'bootredux_insert_codes', 'settings' => 'bootredux_header_code', 'type' => 'textarea' ) ) ); $wp_customize->add_setting( 'bootredux_footer_code', array( 'default' => '', 'sanitize_callback' => 'esc_attr', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_footer_code', array( 'label' => __( 'Footer Code', 'bootredux' ), 'description' => __( 'Insert codes to be added before the closing </body> tag.', 'bootredux' ), 'section' => 'bootredux_insert_codes', 'settings' => 'bootredux_footer_code', 'type' => 'textarea' ) ) ); //Footer Info / Copyright $wp_customize->add_section( 'bootredux_footer_section', array( 'title' => __( 'Footer', 'bootredux' ), 'priority' => 60, ) ); $wp_customize->add_setting( 'bootredux_footer_text', array( 'default' => '', 'sanitize_callback' => 'wp_filter_kses', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'bootredux_footer_text', array( 'label' => __( 'Copyright / Info Text', 'bootredux' ), 'description' => __( 'Insert the copyright / information in the bottom footer.', 'bootredux' ), 'section' => 'bootredux_footer_section', 'settings' => 'bootredux_footer_text', 'type' => 'textarea' ) ) ); $wp_customize->get_setting( 'bootredux_bootstrap_style' )->transport = 'refresh'; $wp_customize->get_setting( 'bootredux_colorscheme' )->transport = 'refresh'; $wp_customize->get_setting( 'bootredux_browser_color' )->transport = 'refresh'; $wp_customize->get_control( 'background_color' )->section = 'bootredux_site_colors'; } } // endif function_exists( 'bootredux_theme_customize_register' ). add_action( 'customize_register', 'bootredux_theme_customize_register' ); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ if ( ! function_exists( 'bootredux_customize_preview_js' ) ) { /** * Setup JS integration for live previewing. */ function bootredux_customize_preview_js() { wp_enqueue_script( 'bootredux_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20171215', true ); } } add_action( 'customize_preview_init', 'bootredux_customize_preview_js' );