get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->add_panel( 'cyclone_corporate_panel_one', array( 'title' => __('Theme options','cyclone-corporate'), 'description' => __('This is a theme settings section.','cyclone-corporate'), 'priority' => 35, ) ); $wp_customize->add_setting( 'font-color', array( 'default' => '444444', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'font-color', array( 'label' => __('Page/Post Title Font Color','cyclone-corporate'), 'section' => 'colors', 'settings' => 'font-color' ) ) ); $wp_customize->add_section( 'cyclone_corporate_section_three', array( 'title' => __('Slider settings','cyclone-corporate'), 'description' => __('This is a slider settings section. Please add posts for slider and assign category for those posts. Featured image of posts will be slider image and post-content will be slider text.','cyclone-corporate'), 'priority' => 55, 'panel' => 'cyclone_corporate_panel_one', ) ); $wp_customize->add_setting( 'display_option', array( 'default' => 'home', 'sanitize_callback' => 'esc_html' ) ); $wp_customize->add_control( 'display_option', array( 'type' => 'radio', 'label' => __('Display Slider Option:','cyclone-corporate'), 'section' => 'cyclone_corporate_section_three', 'choices' => array( 'home' => __('Home','cyclone-corporate'), 'everywhere' => __('Entire Site','cyclone-corporate'), ), ) ); $categories = get_categories(); $cats = array(); $i = 0; foreach($categories as $category){ if($i==0){ $default = $category->slug; $i++; } $cats[$category->slug] = $category->name; } $wp_customize->add_setting('slider_cat', array( 'default' => $default, 'sanitize_callback' => 'esc_html' )); $wp_customize->add_control( 'cat1_select_box', array( 'settings' => 'slider_cat', 'label' => __('Select Category:','cyclone-corporate'), 'section' => 'cyclone_corporate_section_three', 'type' => 'select', 'choices' => $cats, )); $wp_customize->add_setting( 'slide_number', array( 'default' => '3', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'slide_number', array( 'label' => __('Number of slides:','cyclone-corporate'), 'section' => 'cyclone_corporate_section_three', 'type' => 'text', 'sanitize_callback' => 'esc_html', ) ); $wp_customize->add_setting( 'slider_control', array( 'default' => true, 'sanitize_callback' => 'esc_html' ) ); $wp_customize->add_control( 'slider_control', array( 'type' => 'radio', 'label' => __('Display Next/Previous Arrow:','cyclone-corporate'), 'section' => 'cyclone_corporate_section_three', 'choices' => array( true => __('Yes','cyclone-corporate'), false => __('No','cyclone-corporate'), ), ) ); $wp_customize->add_setting( 'slide_speed', array( 'default' => '7000', 'sanitize_callback' => 'esc_html' ) ); $wp_customize->add_control( 'slide_speed', array( 'label' => __('Slide-show Speed:','cyclone-corporate'), 'description' => __('Slide-show Speed in milliseconds. 1 second= 1000 milliseconds.','cyclone-corporate'), 'section' => 'cyclone_corporate_section_three', 'type' => 'text', 'sanitize_callback' => 'esc_html', ) ); $wp_customize->add_setting( 'slider_effect', array( 'default' => 'fade', 'sanitize_callback' => 'esc_html' ) ); $wp_customize->add_control( 'slider_effect', array( 'type' => 'select', 'label' => __('Please select the slider effect:','cyclone-corporate'), 'section' => 'cyclone_corporate_section_three', 'choices' => array( 'fade' => 'Fade', 'slide' => 'Slide', ), ) ); $wp_customize->add_section( 'cyclone_corporate_section_one', array( 'title' => __('Other setting options','cyclone-corporate'), 'description' => __('This is a other settings section.','cyclone-corporate'), 'priority' => 85, 'panel' => 'cyclone_corporate_panel_one', ) ); $wp_customize->add_section( 'cyclone_corporate_section_nine', array( 'title' => __('Social section','cyclone-corporate'), 'description' => __('This social settings section.','cyclone-corporate'), 'priority' => 45, 'panel' => 'cyclone_corporate_panel_one', ) ); $wp_customize->add_setting( 'facebook_link', array( 'default' => 'Add facebook link...', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'facebook_link', array( 'label' => __('Facebook link','cyclone-corporate'), 'section' => 'cyclone_corporate_section_nine', 'type' => 'text', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_setting( 'twitter_link', array( 'default' => 'Add twitter link...', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'twitter_link', array( 'label' => __('Twitter link','cyclone-corporate'), 'section' => 'cyclone_corporate_section_nine', 'type' => 'text', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_setting( 'pinterest_link', array( 'default' => 'Add pinterest link...', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'pinterest_link', array( 'label' => __('Pinterest link','cyclone-corporate'), 'section' => 'cyclone_corporate_section_nine', 'type' => 'text', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_setting( 'linkedin_link', array( 'default' => 'Add linkedin link...', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'linkedin_link', array( 'label' => __('Linkedin link','cyclone-corporate'), 'section' => 'cyclone_corporate_section_nine', 'type' => 'text', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_setting( 'googleplus_link', array( 'default' => 'Add google-plus link...', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'googleplus_link', array( 'label' => __('Google-plus link','cyclone-corporate'), 'section' => 'cyclone_corporate_section_nine', 'type' => 'text', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_setting( 'dribbble_link', array( 'default' => 'Add dribbble link...', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'dribbble_link', array( 'label' => __('Dribbble link','cyclone-corporate'), 'section' => 'cyclone_corporate_section_nine', 'type' => 'text', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_setting( 'menu-color', array( 'default' => '047094', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'menu-color', array( 'label' => __('Header Menu Background Color','cyclone-corporate'), 'section' => 'cyclone_corporate_section_one', 'settings' => 'menu-color', ) ) ); $wp_customize->add_setting( 'color-setting', array( 'default' => '#000000', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'color-setting', array( 'label' => __('Footer Background Color','cyclone-corporate'), 'section' => 'cyclone_corporate_section_one', 'settings' => 'color-setting', ) ) ); $wp_customize->add_setting( 'copyright_textbox', array( 'default' => 'Default copyright text', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'copyright_textbox', array( 'label' => __('Copyright text','cyclone-corporate'), 'section' => 'cyclone_corporate_section_one', 'type' => 'text', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_setting( 'search_placeholder', array( 'default' => 'search...', 'sanitize_callback' => 'esc_html' ) ); $wp_customize->add_control( 'search_placeholder', array( 'label' => __('Search Placeholder','cyclone-corporate'), 'section' => 'cyclone_corporate_section_one', 'type' => 'text', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_setting( 'powered_textbox', array( 'default' => 'Default powered by text', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'powered_textbox', array( 'label' => __('Powered by text','cyclone-corporate'), 'section' => 'cyclone_corporate_section_one', 'type' => 'text', 'sanitize_callback' => 'esc_html' ) ); $wp_customize->add_setting( 'poweredby_url', array( 'default' => 'Default url...', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'poweredby_url', array( 'label' => __('Powered by link','cyclone-corporate'), 'section' => 'cyclone_corporate_section_one', 'type' => 'text', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_setting( 'logo_icon', array( 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Upload_Control( $wp_customize, 'logo_icon', array( 'label' => __('Logo','cyclone-corporate'), 'description' => __('Recommended logo size is 180x110.','cyclone-corporate'), 'section' => 'cyclone_corporate_section_one', 'settings' => 'logo_icon' ) ) ); $wp_customize->add_setting( 'logo_placement', array( 'default' => 'left', 'sanitize_callback' => 'esc_html' ) ); $wp_customize->add_control( 'logo_placement', array( 'type' => 'radio', 'label' => __('Logo placement','cyclone-corporate'), 'section' => 'cyclone_corporate_section_one', 'choices' => array( 'left' => __('Left','cyclone-corporate'), 'center' => __('Center','cyclone-corporate'), ), ) ); $wp_customize->add_panel( 'cyclone_corporate_panel_two', array( 'title' => __('Homepage Sections','cyclone-corporate'), 'description' => __('This is a homepage settings section.','cyclone-corporate'), 'priority' => 35, ) ); $wp_customize->add_section( 'cyclone_corporate_section_seven', array( 'title' => __('Our Features Section','cyclone-corporate'), 'description' => __('This is Homepage welcome features section. Title will be features title & Description will be features description. For icon, just add glyphicons name such as pencil, shield etc for each of the features.','cyclone-corporate'), 'priority' => 55, 'panel' => 'cyclone_corporate_panel_two', ) ); $wp_customize->add_setting( 'features_title', array( 'default' => 'Our Services', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'features_title', array( 'label' => __('Our Features Title','cyclone-corporate'), 'section' => 'cyclone_corporate_section_seven', 'type' => 'text', 'sanitize_callback' => 'sanitize_text_field', ) ); $categoriess = get_categories(); $catss = array(); $i = 0; foreach($categoriess as $category){ if($i==0){ $default1 = $category->slug; $i++; } $catss[$category->slug] = $category->name; } $wp_customize->add_setting('features_cat', array( 'default' => $default1, 'sanitize_callback' => 'esc_html' )); $wp_customize->add_control( 'cat_select_box', array( 'settings' => 'features_cat', 'label' => __('Select Category:','cyclone-corporate'), 'section' => 'cyclone_corporate_section_seven', 'type' => 'select', 'choices' => $catss, )); $wp_customize->add_setting( 'features_no', array( 'default' => '3', 'sanitize_callback' => 'esc_html' ) ); $wp_customize->add_control( 'features_no', array( 'type' => 'select', 'label' => __('Please select number of features to show:','cyclone-corporate'), 'section' => 'cyclone_corporate_section_seven', 'choices' => array( '1' => '1', '2' => '2', '3' => '3', ), ) ); $wp_customize->add_section( 'cyclone_corporate_section_eleven', array( 'title' => __('Featured section','cyclone-corporate'), 'description' => __('This is featured section.','cyclone-corporate'), 'priority' => 65, 'panel' => 'cyclone_corporate_panel_two', ) ); $wp_customize->add_setting( 'featured_one_desc', array( 'default' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.', 'sanitize_callback' => 'esc_html' ) ); $wp_customize->add_control( 'featured_one_desc', array( 'label' => __('Featured description','cyclone-corporate'), 'section' => 'cyclone_corporate_section_eleven', 'type' => 'textarea', 'sanitize_callback' => 'esc_html', ) ); $wp_customize->add_setting( 'featured_one_title', array( 'default' => 'Contact Us', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'featured_one_title', array( 'label' => __('Button Text','cyclone-corporate'), 'section' => 'cyclone_corporate_section_eleven', 'type' => 'text', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_setting( 'featured_url', array( 'default' => 'Default url...', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'featured_url', array( 'label' => __('Button Link','cyclone-corporate'), 'section' => 'cyclone_corporate_section_eleven', 'type' => 'text', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_setting( 'featured_banner', array( 'sanitize_callback' => 'esc_url_raw','default' => get_template_directory_uri()."/assets/images/featured_banner/featured-banner.jpg" )); $wp_customize->add_control( new WP_Customize_Upload_Control( $wp_customize, 'featured_banner', array( 'label' => __('Featured Banner','cyclone-corporate'), 'description' => __('Recommended size is w=1140, h=200.','cyclone-corporate'), 'section' => 'cyclone_corporate_section_eleven', 'settings' => 'featured_banner' ) ) ); $wp_customize->add_section( 'cyclone_corporate_section_blog', array( 'title' => __('Blog and Sidebar options','cyclone-corporate'), 'description' => __('This is a blog settings section as well as sidebar section.','cyclone-corporate'), 'priority' => 45, 'panel' => 'cyclone_corporate_panel_one', ) ); $wp_customize->add_setting('hide_category',array( 'sanitize_callback' => 'esc_html')); $wp_customize->add_control( 'hide_category', array( 'type' => 'checkbox', 'label' => __('Hide Category Name on Posts List','cyclone-corporate'), 'section' => 'cyclone_corporate_section_blog', ) ); $wp_customize->add_setting( 'sidebar_placement', array( 'default' => 'right', array( 'sanitize_callback' => 'esc_url_raw'), ) ); $wp_customize->add_control( 'sidebar_placement', array( 'type' => 'radio', 'label' => __('Sidebar placement for Single Post','cyclone-corporate'), 'section' => 'cyclone_corporate_section_blog', 'choices' => array( 'left' => __('Left','cyclone-corporate'), 'right' => __('Right','cyclone-corporate'), 'no-sidebar' => __('No Sidebar/Full Width','cyclone-corporate'), ), ) ); $wp_customize->add_setting( 'sidebar_page', array( 'default' => 'yes', array( 'sanitize_callback' => 'esc_url_raw'), ) ); $wp_customize->add_control( 'sidebar_page', array( 'type' => 'radio', 'label' => __('Display Sidebar in Single Page','cyclone-corporate'), 'section' => 'cyclone_corporate_section_blog', 'choices' => array( 'yes' => __('Yes','cyclone-corporate'), 'no' => __('No','cyclone-corporate'), ), ) ); $wp_customize->add_setting( 'exc_cat', array( 'default' => '', 'sanitize_callback' => 'esc_html' ) ); $wp_customize->add_control( 'exc_cat', array( 'label' => __('Exclude categories from Blog List','cyclone-corporate'), 'section' => 'cyclone_corporate_section_blog', 'type' => 'text', 'sanitize_callback' => 'esc_html', ) ); $wp_customize->add_setting( 'exc_len', array( 'default' => '40', 'sanitize_callback' => 'esc_html' ) ); $wp_customize->add_control( 'exc_len', array( 'label' => __('Excerpt Length in blog list','cyclone-corporate'), 'description' => __('Number of words before "read more" button in blog list','cyclone-corporate'), 'section' => 'cyclone_corporate_section_blog', 'type' => 'text', 'sanitize_callback' => 'esc_html', ) ); $wp_customize->add_section( 'cyclone_corporate_section_advanced', array( 'title' => __('Custom CSS','cyclone-corporate'), 'priority' => 105, 'panel' => 'cyclone_corporate_panel_one', ) ); $wp_customize->add_setting( 'custom_theme_css', array( 'default' => '', 'sanitize_callback' => 'esc_html' ) ); $wp_customize->add_control( 'custom_theme_css', array( 'label' => __( 'Custom Theme CSS','cyclone-corporate' ), 'type' => 'textarea', 'section' => 'cyclone_corporate_section_advanced', ) ); } add_action( 'customize_register', 'cyclone_corporate_customize_register' ); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function cyclone_corporate_customize_preview_js() { wp_enqueue_script( 'cyclone-corporate_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true ); } add_action( 'customize_preview_init', 'cyclone_corporate_customize_preview_js' ); function cyclone_slider() { $effect = esc_attr(get_theme_mod( 'slider_effect','fade' )); $control = esc_attr(get_theme_mod( 'slider_control',true )); $speed = esc_attr(get_theme_mod( 'slide_speed','7000' )); if($control==1){ $control=true; } else{ $control=false; } echo ''; } add_action( 'wp_head', 'cyclone_slider' ); function cyclone_customize_css() { $font_color = esc_attr(get_theme_mod('font-color')); $color_setting = esc_attr(get_theme_mod('color-setting')); $menu_color = esc_attr(get_theme_mod('menu-color')); ?>