get_setting('blogname')->transport = 'postMessage'; $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; $wp_customize->get_setting('header_textcolor')->transport = 'postMessage'; $wp_customize->add_setting( 'header_image_helper', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new Azuma_Customize_Heading_Small( $wp_customize, 'header_image_helper', array( 'settings' => 'header_image_helper', 'section' => 'header_image', 'label' => esc_html__( 'See "Layout Options" > "Page Title Layout" for where the header image is used.', 'azuma' ) ) ) ); $wp_customize->add_setting( 'hi_color', array( 'default' => '#ff7800', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'hi_color', array( 'label' => esc_html__( 'Primary Color', 'azuma' ), 'description'=> esc_html__( 'Site title, links, buttons and other highlights.', 'azuma' ), 'settings' => 'hi_color', 'section' => 'colors', ) ) ); $wp_customize->add_setting( 'hi_color2', array( 'default' => '#2d364c', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'hi_color2', array( 'label' => esc_html__( 'Secondary Color', 'azuma' ), 'description'=> esc_html__( 'Header, sidebar, footer, posts (hover over) and products (hover over) background color.', 'azuma' ), 'settings' => 'hi_color2', 'section' => 'colors', ) ) ); $wp_customize->add_section( 'layout_options', array( 'title' => esc_html__( 'Layout Options', 'azuma' ), 'priority' => 26, ) ); $wp_customize->add_setting( 'container_width', array( 'default' => '1920', 'transport' => 'postMessage', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( 'container_width', array( 'settings' => 'container_width', 'section' => 'layout_options', 'label' => esc_html__( 'Container Width', 'azuma' ), 'type' => 'number', 'input_attrs' => array( 'min' => 1120, 'max' => 2560, 'step' => 1, ), ) ); $wp_customize->add_setting( 'header_search_off', array( 'default' => 0, 'transport' => 'postMessage', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( 'header_search_off', array( 'section' => 'layout_options', 'label' => esc_html__( 'Disable Search Form in Header', 'azuma' ), 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'page_title_style', array( 'default' => '', 'sanitize_callback' => 'azuma_sanitize_radio_select' ) ); $wp_customize->add_control( new Azuma_Image_Radio_Control( $wp_customize, 'page_title_style', array( 'type' => 'radio', 'label' => esc_html__( 'Page Title Layout', 'azuma' ), 'description' => esc_html__( 'Large image header uses default "Header Image" or page/post "Featured Image" if available.', 'azuma' ), 'section' => 'layout_options', 'settings' => 'page_title_style', 'choices' => array( '' => get_template_directory_uri() . '/images/header-title-style-1.png', '2' => get_template_directory_uri() . '/images/header-title-style-2.png', ) ) ) ); $wp_customize->add_setting( 'grid_layout', array( 'default' => '4', 'transport' => 'postMessage', 'sanitize_callback' => 'azuma_sanitize_radio_select' ) ); $wp_customize->add_control( new Azuma_Image_Radio_Control( $wp_customize, 'grid_layout', array( 'type' => 'radio', 'label' => esc_html__( 'Blog - Grid Layout', 'azuma' ), 'section' => 'layout_options', 'settings' => 'grid_layout', 'choices' => array( '1' => get_template_directory_uri() . '/images/mag-layout-1.png', '2' => get_template_directory_uri() . '/images/mag-layout-2.png', '3' => get_template_directory_uri() . '/images/mag-layout-3.png', '4' => get_template_directory_uri() . '/images/mag-layout-4.png', ) ) ) ); $wp_customize->add_setting( 'sidebar_position', array( 'default' => 'right', 'sanitize_callback' => 'azuma_sanitize_choices', ) ); $wp_customize->add_control( 'sidebar_position', array( 'label' => esc_html__( 'Sidebar Position', 'azuma' ), 'type' => 'select', 'section' => 'layout_options', 'choices' => array( 'left' => esc_html__( 'Left', 'azuma' ), 'right' => esc_html__( 'Right', 'azuma' ), ), ) ); $wp_customize->add_setting( 'sticky_footer', array( 'default' => 0, 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( 'sticky_footer', array( 'settings' => 'sticky_footer', 'section' => 'layout_options', 'label' => esc_html__( 'Enable Sticky Footer', 'azuma' ), 'type' => 'checkbox', ) ); $wp_customize->add_section( 'homepage_options', array( 'title' => esc_html__( 'Homepage Sections', 'azuma' ), 'description' => esc_html__( 'You should first select a Static Homepage if you have not already done so. See: "Homepage Settings"', 'azuma' ), 'priority' => 27, ) ); $wp_customize->add_setting( 'woo_home_enable', array( 'default' => 0, 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( 'woo_home_enable', array( 'settings' => 'woo_home_enable', 'section' => 'homepage_options', 'label' => esc_html__( 'Activate Homepage Sections', 'azuma' ), 'description' => esc_html__( 'Page Content is displayed by default if Homepage Sections is disabled.', 'azuma' ), 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'woo_home[tabs]', array( 'default' => '', 'sanitize_callback' => 'azuma_sanitize_woo_tabs', 'transport' => 'refresh', 'capability' => 'manage_options', ) ); $woo_home_choices = array(); $woo_home_tabs = azuma_woo_home_tabs(); foreach( $woo_home_tabs as $key => $val ){ $woo_home_choices[$key] = $val['label']; } $wp_customize->add_control( new Azuma_Sortable_Checkboxes( $wp_customize, 'woo_home', array( 'section' => 'homepage_options', 'settings' => 'woo_home[tabs]', 'label' => esc_html__( 'Homepage Sections', 'azuma' ), 'description' => esc_html__( 'Check the box to display. Sortable: drag and drop into your preferred order.', 'azuma' ), 'choices' => $woo_home_choices, ) ) ); $wp_customize->add_setting( 'heading_featured_services', array( 'default' => '', 'sanitize_callback' => 'azuma_sanitize_text' ) ); $wp_customize->add_control( new Azuma_Customize_Heading_Large( $wp_customize, 'heading_featured_services', array( 'settings' => 'heading_featured_services', 'section' => 'homepage_options', 'label' => esc_html__( 'Featured Services', 'azuma' ) ) ) ); //FEATURES (MAX 3) for( $i = 1; $i < 4; $i++ ){ $wp_customize->add_setting( 'featured_header'.$i, array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new Azuma_Customize_Heading_Small( $wp_customize, 'featured_header'.$i, array( 'settings' => 'featured_header'.$i, 'section' => 'homepage_options', 'label' => esc_html__( 'Feature ', 'azuma' ).$i ) ) ); $wp_customize->add_setting( 'featured_page_icon'.$i, array( 'default' => azuma_featured_icon_defaults($i), 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new Azuma_Icon_Choices( $wp_customize, 'featured_page_icon'.$i, array( 'settings' => 'featured_page_icon'.$i, 'section' => 'homepage_options', 'type' => 'select', 'label' => esc_html__( 'Icon', 'azuma' ), 'description' => 'featuredpageicon'.$i //not for display, no translation as using only for unique element name ) ) ); $wp_customize->add_setting( 'featured_page_link'.$i, array( 'default' => '', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( 'featured_page_link'.$i, array( 'settings' => 'featured_page_link'.$i, 'section' => 'homepage_options', 'type' => 'dropdown-pages', 'label' => esc_html__( 'Select Page', 'azuma' ), 'description' => esc_html__( 'Displays title and excerpt of selected page. You can add an optional hand-crafted excerpt in the page editor (make sure []excerpt is checked in Screen Options).', 'azuma' ) ) ); } // SECTION - Typography $wp_customize->add_section( 'typography', array( 'title' => esc_html__( 'Typography & Fonts', 'azuma' ), 'priority' => 42, ) ); // Setting - Font - Header $wp_customize->add_setting( 'font_site_title', array( 'default' => 'Rajdhani:300,400,500,600,700', 'transport' => 'postMessage', 'sanitize_callback' => 'azuma_sanitize_choices', ) ); $wp_customize->add_control( 'font_site_title', array( 'label' => esc_html__( 'Site Title', 'azuma' ), 'type' => 'select', 'section' => 'typography', 'choices' => azuma_google_fonts_array(), ) ); // Setting - Font - Navigation $wp_customize->add_setting( 'font_nav', array( 'default' => 'Rajdhani:300,400,500,600,700', 'transport' => 'postMessage', 'sanitize_callback' => 'azuma_sanitize_choices', ) ); $wp_customize->add_control( 'font_nav', array( 'label' => esc_html__( 'Navigation', 'azuma' ), 'type' => 'select', 'section' => 'typography', 'choices' => azuma_google_fonts_array(), ) ); // Setting - Font - Content $wp_customize->add_setting( 'font_content', array( 'default' => 'Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i', 'transport' => 'postMessage', 'sanitize_callback' => 'azuma_sanitize_choices', ) ); $wp_customize->add_control( 'font_content', array( 'label' => esc_html__( 'Content', 'azuma' ), 'type' => 'select', 'section' => 'typography', 'choices' => azuma_google_fonts_array(), ) ); // Setting - Font - Headings $wp_customize->add_setting( 'font_headings', array( 'default' => 'Rajdhani:300,400,500,600,700', 'transport' => 'postMessage', 'sanitize_callback' => 'azuma_sanitize_choices', ) ); $wp_customize->add_control( 'font_headings', array( 'label' => esc_html__( 'Headings', 'azuma' ), 'type' => 'select', 'section' => 'typography', 'choices' => azuma_google_fonts_array(), ) ); $wp_customize->add_setting( 'heading_font_site_title', array( 'default' => '', 'sanitize_callback' => 'azuma_sanitize_text' ) ); $wp_customize->add_control( new Azuma_Customize_Heading_Small( $wp_customize, 'heading_font_site_title', array( 'settings' => 'heading_font_site_title', 'section' => 'typography', 'label' => esc_html__( 'Site Title', 'azuma' ) ) ) ); $wp_customize->add_setting( 'fs_site_title', array( 'default' => '56', 'transport' => 'postMessage', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( 'fs_site_title', array( 'settings' => 'fs_site_title', 'section' => 'typography', 'label' => esc_html__( 'Size', 'azuma' ), 'type' => 'number', 'input_attrs' => array( 'min' => 14, 'max' => 80, 'step' => 1, ), ) ); $wp_customize->add_setting( 'fw_site_title', array( 'default' => '700', 'transport' => 'postMessage', 'sanitize_callback' => 'azuma_sanitize_choices' ) ); $wp_customize->add_control( 'fw_site_title', array( 'label' => esc_html__( 'Weight', 'azuma' ), 'type' => 'select', 'section' => 'typography', 'choices' => array( '100' => '100', '200' => '200', '300' => '300', '400' => '400', '500' => '500', '600' => '600', '700' => '700', '800' => '800', '900' => '900' ) ) ); $wp_customize->add_setting( 'ft_site_title', array( 'default' => 'uppercase', 'transport' => 'postMessage', 'sanitize_callback' => 'azuma_sanitize_choices' ) ); $wp_customize->add_control( 'ft_site_title', array( 'label' => esc_html__( 'Transform', 'azuma' ), 'type' => 'select', 'section' => 'typography', 'choices' => array( 'none' => esc_html__( 'none', 'azuma' ), 'capitalize' => esc_html__( 'capitalize', 'azuma' ), 'lowercase' => esc_html__( 'lowercase', 'azuma' ), 'uppercase' => esc_html__( 'uppercase', 'azuma' ), ) ) ); $wp_customize->add_setting( 'fl_site_title', array( 'default' => '2', 'transport' => 'postMessage', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( 'fl_site_title', array( 'settings' => 'fl_site_title', 'section' => 'typography', 'label' => esc_html__( 'Letter Spacing', 'azuma' ), 'type' => 'number', 'input_attrs' => array( 'min' => -6, 'max' => 20, 'step' => 1, ), ) ); // Section - Go Pro $wp_customize->add_section( 'go_pro_sec' , array( 'title' => esc_html__( 'Go Pro', 'azuma' ), 'priority' => 1, 'description' => esc_html__( 'Upgrade to Azuma Pro for even more cool features and customization options.', 'azuma' ), ) ); $wp_customize->add_control( new Azuma_Customize_Extra_Control( $wp_customize, 'go_pro', array( 'section' => 'go_pro_sec', 'type' => 'pro-link', 'label' => esc_html__( 'Go Pro', 'azuma' ), 'url' => 'https://uxlthemes.com/theme/azuma-pro/', 'priority' => 10 ) ) ); } add_action('customize_register', 'azuma_customize_register'); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function azuma_customize_preview_js() { wp_enqueue_script('azuma_customizer', get_template_directory_uri() . '/functions/js/customizer.js', array('customize-preview'), '1.0', true ); } add_action('customize_preview_init', 'azuma_customize_preview_js'); function azuma_customizer_script() { wp_enqueue_script('azuma-customizer-script', get_template_directory_uri() .'/functions/js/customizer-scripts.js', array("jquery","jquery-ui-draggable"),'', true ); wp_enqueue_script('azuma-sortable-checkbox', get_template_directory_uri() . '/functions/js/azuma-sortable-checkbox.js', array( 'jquery', 'jquery-ui-sortable', 'customize-controls' ) ); wp_enqueue_style( 'azuma-fontawesome', get_template_directory_uri() . '/fontawesome/css/all.min.css' ); wp_enqueue_style('azuma-customizer-style', get_template_directory_uri() .'/functions/css/customizer-style.css'); } add_action('customize_controls_enqueue_scripts', 'azuma_customizer_script'); if( class_exists('WP_Customize_Control') ): class Azuma_Image_Radio_Control extends WP_Customize_Control { public function render_content() { if ( empty( $this->choices ) ) return; $name = '_customize-radio-' . $this->id; ?> label ); ?> description ) { echo '' . esc_html( $this->description ) . ''; } ?>
description ); ?>
label ) ) : ?>description ); ?>
type ) { default: case 'extra': echo '' . sprintf( '%2$s', esc_url( $this->url ), esc_html__( 'More options available', 'azuma' ) ) . '
'; echo '' . $this->description . '
'; break; case 'docs': echo sprintf( '%2$s', esc_url( $this->url ), esc_html__( 'Documentation', 'azuma' ) ); break; case 'pro-link': echo sprintf( '%2$s', esc_url( $this->url ), esc_html__( 'Go Pro', 'azuma' ) ); break; case 'line' : echo '