add_section( 'colors', array( 'title' => esc_html__( 'Colors', 'fasto' ), 'priority' => 10, 'capability' => 'edit_theme_options', 'description' => esc_html__('Allows you to change theme colors', 'fasto'), ) ); # Main color 1 $wp_customize->add_setting( 'color1', array( 'default' => '#ff7c34', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fasto_color1', array( 'label' => esc_html__( 'Main color 1', 'fasto' ), 'description' => esc_html__( 'Main theme color', 'fasto' ), 'settings' => 'color1', 'priority' => 10, 'section' => 'colors', ) ) ); # Main color 2 $wp_customize->add_setting( 'color2', array( 'default' => '#8BC34A', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fasto_color2', array( 'label' => esc_html__( 'Main color 2', 'fasto' ), 'description' => esc_html__( 'Main theme second color', 'fasto' ), 'settings' => 'color2', 'priority' => 10, 'section' => 'colors', ) ) ); # Body text color $wp_customize->add_setting( 'body_color', array( 'default' => '#5c6279', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fasto_body_color', array( 'label' => esc_html__( 'Body text color', 'fasto' ), 'description' => esc_html__( 'The color of body text', 'fasto' ), 'settings' => 'body_color', 'priority' => 10, 'section' => 'colors', ) ) ); # Headings colors $wp_customize->add_setting( 'headings_color', array( 'default' => '#0e1638', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fasto_headings_color', array( 'label' => esc_html__( 'Other body colors', 'fasto' ), 'description' => esc_html__( 'Colors of headings, links etc', 'fasto' ), 'settings' => 'headings_color', 'priority' => 10, 'section' => 'colors', ) ) ); # Category background $wp_customize->add_setting( 'category_color', array( 'default' => '#ff7c34', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fasto_category_color', array( 'label' => esc_html__( 'Category background', 'fasto' ), 'description' => esc_html__( 'Background of post category', 'fasto' ), 'settings' => 'category_color', 'priority' => 10, 'section' => 'colors', ) ) ); # Footer background $wp_customize->add_setting( 'footer_color', array( 'default' => '#000000', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_category_color', array( 'label' => esc_html__( 'Footer background', 'fasto' ), 'description' => esc_html__( 'Background for footer', 'fasto' ), 'settings' => 'footer_color', 'priority' => 10, 'section' => 'colors', ) ) ); # # Section - Blog # $wp_customize->add_section( 'fasto_blog', array( 'title' => esc_html__( 'Blog', 'fasto' ), 'priority' => 10 ) ); # Blog layout $wp_customize->add_setting( 'blog-layout', array( 'default' => 'grid-3', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fasto_sanitize_select_or_radio', ) ); $wp_customize->add_control( 'blog-layout', array( 'label' => esc_html__( 'Choose blog layout', 'fasto' ), 'description' => esc_html__( 'Select your blog layout', 'fasto' ), 'section' => 'fasto_blog', 'type' => 'radio', 'choices' => array( 'grid-4' => esc_html__('Grid 4 per row','fasto'), 'grid-3' => esc_html__('Grid 3 per row','fasto'), 'grid-2' => esc_html__('Grid 2 with sidebar','fasto'), 'grid-1' => esc_html__('Blog classic with sidebar','fasto') ) ) ); # Blog single layout $wp_customize->add_setting( 'blog-single-layout', array( 'default' => 'sidebar', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fasto_sanitize_select_or_radio', ) ); $wp_customize->add_control( 'blog-single-layout', array( 'label' => esc_html__( 'Single blog layout', 'fasto' ), 'description' => esc_html__( 'Select your single article blog layout', 'fasto' ), 'section' => 'fasto_blog', 'type' => 'radio', 'choices' => array( 'sidebar' => esc_html__('With sidebar','fasto'), 'full' => esc_html__('Full','fasto'), ) ) ); # Blog single image size $wp_customize->add_setting( 'blog-single-thumb', array( 'default' => 'crop', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fasto_sanitize_select_or_radio', ) ); $wp_customize->add_control( 'blog-single-thumb', array( 'label' => esc_html__( 'Single blog image', 'fasto' ), 'description' => esc_html__( 'Choose if you want to display the cropped version of image, or the original one on single articles.', 'fasto' ), 'section' => 'fasto_blog', 'type' => 'radio', 'choices' => array( 'crop' => esc_html__('Cropped','fasto'), 'original' => esc_html__('Original','fasto'), ) ) ); #Floating social article share $wp_customize->add_setting( 'enable-social-share', array( 'default' => '0', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fasto_sanitize_select_or_radio', ) ); $wp_customize->add_control( 'enable-social-share', array( 'label' => esc_html__( 'Floating social share', 'fasto' ), 'description' => esc_html__( 'Enables floating social share on single article.', 'fasto' ), 'section' => 'fasto_blog', 'type' => 'radio', 'choices' => array( '1' => esc_html__('Enable','fasto'), '0' => esc_html__('Disable','fasto'), ) ) ); #Social article share after post $wp_customize->add_setting( 'enable-social-share-after', array( 'default' => '1', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fasto_sanitize_select_or_radio', ) ); $wp_customize->add_control( 'enable-social-share-after', array( 'label' => esc_html__( 'Regular social share', 'fasto' ), 'description' => esc_html__( 'Enables social share at the end of article.', 'fasto' ), 'section' => 'fasto_blog', 'type' => 'radio', 'choices' => array( '1' => esc_html__('Enable','fasto'), '0' => esc_html__('Disable','fasto'), ) ) ); # # Section - Typography # $wp_customize->add_section( 'fasto_typography', array( 'title' => esc_html__( 'Typography', 'fasto' ), 'priority' => 10 ) ); # Headings font $wp_customize->add_setting( 'heading-font', array( 'default' => 'roboto', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fasto_sanitize_select_or_radio', ) ); $wp_customize->add_control( 'heading-font', array( 'label' => esc_html__( 'Headings font', 'fasto' ), 'description' => esc_html__( 'Select headings font', 'fasto' ), 'section' => 'fasto_typography', 'type' => 'select', 'choices' => array( 'roboto' => esc_html__('Roboto','fasto'), 'poppins' => esc_html__('Poppins','fasto'), 'open-sans' => esc_html__('Open Sans','fasto'), 'lato' => esc_html__('Lato','fasto'), 'oswald' => esc_html__('Oswald','fasto'), 'source-sans-pro' => esc_html__('Source Sans Pro','fasto'), 'montserrat' => esc_html__('Montserrat','fasto'), 'raleway' => esc_html__('Raleway','fasto'), 'nunito-sans' => esc_html__('Nunito Sans','fasto'), 'work-sans' => esc_html__('Work Sans','fasto'), ) ) ); # Headings font weight $wp_customize->add_setting( 'heading-font-w', array( 'default' => '700', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fasto_sanitize_select_or_radio', ) ); $wp_customize->add_control( 'heading-font-w', array( 'label' => esc_html__( 'Headings font weight', 'fasto' ), 'description' => esc_html__( 'Select weight of headings font ', 'fasto' ), 'section' => 'fasto_typography', 'type' => 'select', 'choices' => array( '100' => esc_html__('100','fasto'), '300' => esc_html__('300','fasto'), '400' => esc_html__('400','fasto'), '500' => esc_html__('500','fasto'), '700' => esc_html__('700','fasto'), '900' => esc_html__('900','fasto'), ) ) ); # Body font $wp_customize->add_setting( 'body-font', array( 'default' => 'roboto', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fasto_sanitize_select_or_radio', ) ); $wp_customize->add_control( 'body-font', array( 'label' => esc_html__( 'Body font', 'fasto' ), 'description' => esc_html__( 'Select body font', 'fasto' ), 'section' => 'fasto_typography', 'type' => 'select', 'choices' => array( 'roboto' => esc_html__('Roboto','fasto'), 'poppins' => esc_html__('Poppins','fasto'), 'open-sans' => esc_html__('Open Sans','fasto'), 'lato' => esc_html__('Lato','fasto'), 'oswald' => esc_html__('Oswald','fasto'), 'source-sans-pro' => esc_html__('Source Sans Pro','fasto'), 'montserrat' => esc_html__('Montserrat','fasto'), 'raleway' => esc_html__('Raleway','fasto'), 'nunito-sans' => esc_html__('Nunito Sans','fasto'), 'work-sans' => esc_html__('Work Sans','fasto'), ) ) ); # Headings font weight $wp_customize->add_setting( 'body-font-w', array( 'default' => '400', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fasto_sanitize_select_or_radio', ) ); $wp_customize->add_control( 'body-font-w', array( 'label' => esc_html__( 'Body font weight', 'fasto' ), 'description' => esc_html__( 'Select weight of body font ', 'fasto' ), 'section' => 'fasto_typography', 'type' => 'select', 'choices' => array( '100' => esc_html__('100','fasto'), '300' => esc_html__('300','fasto'), '400' => esc_html__('400','fasto'), '500' => esc_html__('500','fasto'), '700' => esc_html__('700','fasto'), '900' => esc_html__('900','fasto'), ) ) ); # # Section - Social profiles # $wp_customize->add_section( 'fasto_social', array( 'title' => esc_html__( 'Social profiles', 'fasto' ), 'priority' => 12 ) ); # Facebook $wp_customize->add_setting( 'facebook', array( 'default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( 'facebook', array( 'label' => esc_html__( 'Facebook URL', 'fasto' ), 'description' => esc_html__( 'Do not forget http://', 'fasto' ), 'section' => 'fasto_social', 'type' => 'text', ) ); # Twitter $wp_customize->add_setting( 'twitter', array( 'default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( 'twitter', array( 'label' => esc_html__( 'Twitter URL', 'fasto' ), 'description' => esc_html__( 'Do not forget http://', 'fasto' ), 'section' => 'fasto_social', 'type' => 'text', ) ); # Youtube $wp_customize->add_setting( 'youtube', array( 'default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( 'youtube', array( 'label' => esc_html__( 'Youtube URL', 'fasto' ), 'description' => esc_html__( 'Do not forget http://', 'fasto' ), 'section' => 'fasto_social', 'type' => 'text', ) ); # Linkedin $wp_customize->add_setting( 'linkedin', array( 'default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( 'linkedin', array( 'label' => esc_html__( 'Linkedin URL', 'fasto' ), 'description' => esc_html__( 'Do not forget http://', 'fasto' ), 'section' => 'fasto_social', 'type' => 'text', ) ); # Pinterest $wp_customize->add_setting( 'pinterest', array( 'default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( 'pinterest', array( 'label' => esc_html__( 'Pinterest URL', 'fasto' ), 'description' => esc_html__( 'Do not forget http://', 'fasto' ), 'section' => 'fasto_social', 'type' => 'text', ) ); # Dribbble $wp_customize->add_setting( 'dribbble', array( 'default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( 'dribbble', array( 'label' => esc_html__( 'Dribbble URL', 'fasto' ), 'description' => esc_html__( 'Do not forget http://', 'fasto' ), 'section' => 'fasto_social', 'type' => 'text', ) ); # Instagram $wp_customize->add_setting( 'instagram', array( 'default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( 'instagram', array( 'label' => esc_html__( 'Instagram URL', 'fasto' ), 'description' => esc_html__( 'Do not forget http://', 'fasto' ), 'section' => 'fasto_social', 'type' => 'text', ) ); # Behance $wp_customize->add_setting( 'behance', array( 'default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( 'behance', array( 'label' => esc_html__( 'Behance URL', 'fasto' ), 'description' => esc_html__( 'Do not forget http://', 'fasto' ), 'section' => 'fasto_social', 'type' => 'text', ) ); # # Section - Optimize # $wp_customize->add_section( 'fasto_optimize', array( 'title' => esc_html__( 'Optimize', 'fasto' ), 'priority' => 13 ) ); # Lazy load $wp_customize->add_setting( 'lazy-load', array( 'default' => '0', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fasto_sanitize_select_or_radio', ) ); $wp_customize->add_control( 'lazy-load', array( 'label' => esc_html__( 'Lazy load', 'fasto' ), 'description' => esc_html__( 'If enabled, images and ads will be displayed using lazy load. This increase your website loading speed.', 'fasto' ), 'section' => 'fasto_optimize', 'type' => 'radio', 'choices' => array( '1' => esc_html__('Enable','fasto'), '0' => esc_html__('Disable','fasto'), ) ) ); # Lazy load $wp_customize->add_setting( 'inline-css', array( 'default' => '0', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fasto_sanitize_select_or_radio', ) ); $wp_customize->add_control( 'inline-css', array( 'label' => esc_html__( 'Inline critical CSS', 'fasto' ), 'description' => esc_html__( 'If enabled, the main CSS file will be inlined into the head. This will speed up loading time.', 'fasto' ), 'section' => 'fasto_optimize', 'type' => 'radio', 'choices' => array( '1' => esc_html__('Enable','fasto'), '0' => esc_html__('Disable','fasto'), ) ) ); # # Section - Copyright # $wp_customize->add_section( 'fasto_copyright', array( 'title' => esc_html__( 'Copyright', 'fasto' ), 'priority' => 999 ) ); # Copyright $wp_customize->add_setting( 'enable-copyright', array( 'default' => '1', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fasto_sanitize_select_or_radio', ) ); $wp_customize->add_control( 'enable-copyright', array( 'label' => esc_html__( 'Copyright', 'fasto' ), 'description' => esc_html__( 'Copyright link from footer. If you want to support us, please leave this to enable. Thanks, you rock!', 'fasto' ), 'section' => 'fasto_copyright', 'type' => 'radio', 'choices' => array( '1' => esc_html__('Enable','fasto'), '0' => esc_html__('Disable','fasto'), ) ) ); //WooCommerce if ( class_exists( 'WooCommerce' ) ){ # # Section - WooCommerce # $wp_customize->add_section( 'fasto_woo', array( 'title' => esc_html__( 'Fasto WooCommerce', 'fasto' ), 'priority' => 10, 'panel' => 'woocommerce', ) ); # Shop layout $wp_customize->add_setting( 'shop-layout', array( 'default' => 'grid-3', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'fasto_sanitize_select_or_radio', ) ); $wp_customize->add_control( 'shop-layout', array( 'label' => esc_html__( 'Choose shop layout', 'fasto' ), 'description' => esc_html__( 'Select your shop layout', 'fasto' ), 'section' => 'fasto_woo', 'type' => 'radio', 'choices' => array( 'grid-4' => esc_html__('Grid 4 per row','fasto'), 'grid-3' => esc_html__('Grid 3 per row','fasto'), 'grid-2-sidebar' => esc_html__('Grid 2 With Sidebar','fasto'), 'grid-3-sidebar' => esc_html__('Grid 3 With Sidebar','fasto') ) ) ); # Shop per row $wp_customize->add_setting( 'shop-per-page', array( 'default' => 9, 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', ) ); $wp_customize->add_control( 'shop-per-page', array( 'label' => esc_html__( 'Products per page', 'fasto' ), 'description' => esc_html__( 'How many products per page should be displayed', 'fasto' ), 'section' => 'fasto_woo', 'type' => 'text', ) ); } } public static function header_output() { ?> manager->get_control( $setting->id )->choices; return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); } /* * * * Premium link in customizer * * * */ /* make the check - WP_Customize_Control is not always available */ if ( class_exists( 'WP_Customize_Control' ) ) { class Fasto_Static_Control extends WP_Customize_Control { public $type = 'fasto-static'; public function __construct( $manager, $id, $args = array() ) { parent::__construct( $manager, $id, $args ); } public function render_content() { if ( ! empty( $this->label ) ) : ?>label ); ?>description ) ) : ?>
description ); ?>
add_section( 'fasto_premium', array( 'title' => esc_html__( 'Check our Premium Theme', 'fasto' ), 'priority' => 999 ) ); $wp_customize->add_setting( 'fasto-premium', array( 'default' => '', 'sanitize_callback' => '__return_false', ) ); $wp_customize->add_control( new Fasto_Static_Control( $wp_customize, 'check_premium', array( 'label' => esc_html__( 'Take a peek.', 'fasto' ), 'section' => 'fasto_premium', 'settings' => 'fasto-premium', 'description' => ''.esc_html__( 'Check our Premium Theme', 'fasto' ).'' ) ) ); } }