$default_background_color, ) ) ); /** * Filter the arguments used when adding 'custom-header' support in technesmart. * * @param array $args { * An array of custom-header support arguments. * * @type string $default-text-color Default color of the header text. * @type int $width Width in pixels of the custom header image. Default 1200. * @type int $height Height in pixels of the custom header image. Default 280. * @type bool $flex-height Whether to allow flexible-height header images. Default true. * @type callable $wp-head-callback Callback function used to style the header image and text * displayed on the blog. * } */ add_theme_support( 'custom-header', apply_filters( 'techsmart_custom_header_args', array( 'default-text-color' => $default_text_color, 'width' => 1200, 'height' => 280, 'flex-height' => true, 'wp-head-callback' => 'techsmart_header_style', ) ) ); } add_action( 'after_setup_theme', 'techsmart_custom_header_and_background' ); if ( ! function_exists( 'techsmart_header_style' ) ) : /** * Styles the header text displayed on the site. * * Create your own techsmart_header_style() function to override in a child theme. * * @see techsmart_custom_header_and_background(). */ function techsmart_header_style() { // If the header text option is untouched, let's bail. if ( display_header_text() ) { return; } // If the header text has been hidden. ?> get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'container_inclusive' => false, 'render_callback' => 'techsmart_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'container_inclusive' => false, 'render_callback' => 'techsmart_customize_partial_blogdescription', ) ); } /** * Getting the actual settings or defaults if not set * */ $techsmart_actual_options = techsmart_settings(); // Add theme option panel $wp_customize->add_panel( 'techsmart_option_panel', array( 'title' => 'Technosmart Options', 'description' => 'This is the theme option panel', 'priority' => 1000, ) ); /* * Settings for typography options * */ // Add typography section to TechSmart option panel $wp_customize->add_section( 'techsmart_fonts_settings', array( 'title' => __( 'Typography','techsmart' ), 'description' => __( 'Here you can manage your theme Font Style','techsmart' ), 'priority' => 10, 'panel' => 'techsmart_option_panel', 'capability' => 'edit_theme_options', ) ); // Add setting for header fonts. $wp_customize->add_setting( 'techsmart_options[header_font]', array( 'default' => esc_attr( $techsmart_actual_options['header_font'] ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'techsmart_sanitize_text', 'transport' => 'postMessage', ) ); // Add control for header fonts $wp_customize->add_control( new techsmart_font_control( $wp_customize, 'header_font', array( 'label' => __('Logo & Header Font Family', 'techsmart'), 'section' => 'techsmart_fonts_settings', 'settings' => 'techsmart_options[header_font]', ) ) ); // Add setting for header font size $wp_customize->add_setting( 'techsmart_options[header_font_size]', array( 'type' => 'option', 'default' => $techsmart_actual_options['header_font_size'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'techsmart_sanitize_number', 'transport' => 'postMessage', ) ); // Add control for header font size $wp_customize->add_control( 'header_font_size', array( 'label' => __( 'Logo & Header Font Size (pixels)', 'techsmart' ), 'type' => 'number', 'section' => 'techsmart_fonts_settings', 'settings' => 'techsmart_options[header_font_size]' ) ); /////// Fonts for Body // Add setting for body fonts. $wp_customize->add_setting( 'techsmart_options[body_font]', array( 'default' => esc_attr( $techsmart_actual_options['body_font'] ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'techsmart_sanitize_text', 'transport' => 'postMessage', ) ); // Add control for body fonts $wp_customize->add_control( new techsmart_font_control( $wp_customize, 'body_font', array( 'label' => __('Body Font Family', 'techsmart'), 'section' => 'techsmart_fonts_settings', 'settings' => 'techsmart_options[body_font]', ) ) ); // Add setting for body font size $wp_customize->add_setting( 'techsmart_options[body_font_size]', array( 'type' => 'option', 'default' => $techsmart_actual_options['body_font_size'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'techsmart_sanitize_number', 'transport' => 'postMessage', ) ); // Add control for body font size $wp_customize->add_control( 'body_font_size', array( 'label' => __( 'Body Font Size (pixels)', 'techsmart' ), 'type' => 'number', 'section' => 'techsmart_fonts_settings', 'settings' => 'techsmart_options[body_font_size]' ) ); /////// Fonts for Menu // Add setting for menu fonts. $wp_customize->add_setting( 'techsmart_options[menu_font]', array( 'default' => esc_attr( $techsmart_actual_options['menu_font'] ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'techsmart_sanitize_text', 'transport' => 'postMessage', ) ); // Add control for body fonts $wp_customize->add_control( new techsmart_font_control( $wp_customize, 'menu_font', array( 'label' => __('Menu Font Family', 'techsmart'), 'section' => 'techsmart_fonts_settings', 'settings' => 'techsmart_options[menu_font]', ) ) ); // Add setting for body font size $wp_customize->add_setting( 'techsmart_options[menu_font_size]', array( 'type' => 'option', 'default' => $techsmart_actual_options['menu_font_size'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'techsmart_sanitize_number', 'transport' => 'postMessage', ) ); // Add control for body font size $wp_customize->add_control( 'menu_font_size', array( 'label' => __( 'Menu Font Size (pixels)', 'techsmart' ), 'type' => 'number', 'section' => 'techsmart_fonts_settings', 'settings' => 'techsmart_options[menu_font_size]' ) ); /////// Fonts for section titles // Add setting for body fonts. $wp_customize->add_setting( 'techsmart_options[section_titles_font]', array( 'default' => esc_attr( $techsmart_actual_options['section_titles_font'] ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'techsmart_sanitize_text', 'transport' => 'postMessage', ) ); // Add control for body fonts $wp_customize->add_control( new techsmart_font_control( $wp_customize, 'section_titles_font', array( 'label' => __('Section Titles Font Family', 'techsmart'), 'section' => 'techsmart_fonts_settings', 'settings' => 'techsmart_options[section_titles_font]', ) ) ); // Add setting for body font size $wp_customize->add_setting( 'techsmart_options[section_titles_font_size]', array( 'type' => 'option', 'default' => $techsmart_actual_options['section_titles_font_size'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'techsmart_sanitize_number', 'transport' => 'postMessage', ) ); // Add control for body font size $wp_customize->add_control( 'section_titles_font_size', array( 'label' => __( 'Section Titles Font Size (pixels)', 'techsmart' ), 'type' => 'number', 'section' => 'techsmart_fonts_settings', 'settings' => 'techsmart_options[section_titles_font_size]' ) ); /////// Fonts for section subtitles // Add setting for body fonts. $wp_customize->add_setting( 'techsmart_options[section_subtitles_font]', array( 'default' => esc_attr( $techsmart_actual_options['section_subtitles_font'] ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'techsmart_sanitize_text', 'transport' => 'postMessage', ) ); // Add control for body fonts $wp_customize->add_control( new techsmart_font_control( $wp_customize, 'section_subtitles_font', array( 'label' => __('Section Subtitles Font Family', 'techsmart'), 'section' => 'techsmart_fonts_settings', 'settings' => 'techsmart_options[section_subtitles_font]', ) ) ); // Add setting for body font size $wp_customize->add_setting( 'techsmart_options[section_subtitles_font_size]', array( 'type' => 'option', 'default' => $techsmart_actual_options['section_subtitles_font_size'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'techsmart_sanitize_number', 'transport' => 'postMessage', ) ); // Add control for body font size $wp_customize->add_control( 'section_subtitles_font_size', array( 'label' => __( 'Section Subtitles Font Size (pixels)', 'techsmart' ), 'type' => 'number', 'section' => 'techsmart_fonts_settings', 'settings' => 'techsmart_options[section_subtitles_font_size]' ) ); /* * Settings for social media options * */ // Add top bar section to TechSmart option panel $wp_customize->add_section( 'techsmart_social_settings', array( 'title' => __( 'Phone & Social Media','techsmart' ), 'description' => __( 'Here you can manage your phone number and social media icon links options','techsmart' ), 'priority' => 15, 'panel' => 'techsmart_option_panel', 'capability' => 'edit_theme_options', ) ); // Phone number $wp_customize->add_setting( 'techsmart_options[phone]', array( 'default' => esc_attr( $techsmart_actual_options['phone'] ), 'type' => 'option', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'phone', array( 'label' => __( 'Phone Number', 'techsmart' ), 'type' => 'text', 'section' => 'techsmart_social_settings', 'settings' => 'techsmart_options[phone]', ) ); // facebook link $wp_customize->add_setting( 'techsmart_options[facebook_link_enabled]', array( 'default' => esc_attr( $techsmart_actual_options['facebook_link_enabled'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_checkbox', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'facebook_link_enabled', array( 'label' => __( 'Display Facebook Link?', 'techsmart' ), 'type' => 'checkbox', 'section' => 'techsmart_social_settings', 'settings' => 'techsmart_options[facebook_link_enabled]', ) ); $wp_customize->add_setting( 'techsmart_options[facebook_link]', array( 'default' => esc_attr( $techsmart_actual_options['facebook_link'] ), 'type' => 'option', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'facebook_link', array( 'label' => __( 'Facebook URL', 'techsmart' ), 'type' => 'url', 'section' => 'techsmart_social_settings', 'settings' => 'techsmart_options[facebook_link]', ) ); // twitter link $wp_customize->add_setting( 'techsmart_options[twitter_link_enabled]', array( 'default' => esc_attr( $techsmart_actual_options['twitter_link_enabled'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_checkbox', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'twitter_link_enabled', array( 'label' => __( 'Display Twitter Link?', 'techsmart' ), 'type' => 'checkbox', 'section' => 'techsmart_social_settings', 'settings' => 'techsmart_options[twitter_link_enabled]', ) ); $wp_customize->add_setting( 'techsmart_options[twitter_link]', array( 'default' => esc_attr( $techsmart_actual_options['twitter_link'] ), 'type' => 'option', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'twitter_link', array( 'label' => __( 'Twitter URL', 'techsmart' ), 'type' => 'url', 'section' => 'techsmart_social_settings', 'settings' => 'techsmart_options[twitter_link]', ) ); // googleplus link $wp_customize->add_setting( 'techsmart_options[googleplus_link_enabled]', array( 'default' => esc_attr( $techsmart_actual_options['googleplus_link_enabled'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_checkbox', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'googleplus_link_enabled', array( 'label' => __( 'Display Google Plus Link?', 'techsmart' ), 'type' => 'checkbox', 'section' => 'techsmart_social_settings', 'settings' => 'techsmart_options[googleplus_link_enabled]', ) ); $wp_customize->add_setting( 'techsmart_options[googleplus_link]', array( 'default' => esc_attr( $techsmart_actual_options['googleplus_link'] ), 'type' => 'option', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'googleplus_link', array( 'label' => __( 'Google Plus URL', 'techsmart' ), 'type' => 'url', 'section' => 'techsmart_social_settings', 'settings' => 'techsmart_options[googleplus_link]' ) ); // instagram link $wp_customize->add_setting( 'techsmart_options[instagram_link_enabled]', array( 'default' => esc_attr( $techsmart_actual_options['instagram_link_enabled'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_checkbox', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'instagram_link_enabled', array( 'label' => __( 'Display Instagram Link?', 'techsmart' ), 'type' => 'checkbox', 'section' => 'techsmart_social_settings', 'settings' => 'techsmart_options[instagram_link_enabled]', ) ); $wp_customize->add_setting( 'techsmart_options[instagram_link]', array( 'default' => esc_attr( $techsmart_actual_options['instagram_link'] ), 'type' => 'option', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'instagram_link', array( 'label' => __( 'Instagram URL', 'techsmart' ), 'type' => 'url', 'section' => 'techsmart_social_settings', 'settings' => 'techsmart_options[instagram_link]' ) ); // linkedin link $wp_customize->add_setting( 'techsmart_options[linkedin_link_enabled]', array( 'default' => esc_attr( $techsmart_actual_options['linkedin_link_enabled'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_checkbox', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'linkedin_link_enabled', array( 'label' => __( 'Display LinkedIn Link?', 'techsmart' ), 'type' => 'checkbox', 'section' => 'techsmart_social_settings', 'settings' => 'techsmart_options[linkedin_link_enabled]', ) ); $wp_customize->add_setting( 'techsmart_options[linkedin_link]', array( 'default' => esc_attr( $techsmart_actual_options['linkedin_link'] ), 'type' => 'option', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'linkedin_link', array( 'label' => __( 'LinkedIn URL', 'techsmart' ), 'type' => 'url', 'section' => 'techsmart_social_settings', 'settings' => 'techsmart_options[linkedin_link]' ) ); /* * Settings for header options * */ // Add header section to TechSmart option panel $wp_customize->add_section( 'techsmart_header_settings', array( 'title' => __( 'Header','techsmart' ), 'description' => __( 'Here you can manage your page header options','techsmart' ), 'priority' => 20, 'panel' => 'techsmart_option_panel', 'capability' => 'edit_theme_options', ) ); // Header section call to action text $wp_customize->add_setting( 'techsmart_options[header_cta_text]', array( 'default' => esc_attr( $techsmart_actual_options['header_cta_text'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'header_cta_text', array( 'label' => __( 'CTA Text for Header', 'techsmart' ), 'type' => 'textarea', 'section' => 'techsmart_header_settings', 'settings' => 'techsmart_options[header_cta_text]', ) ); // Header CTA link $wp_customize->add_setting( 'techsmart_options[header_cta_link_enabled]', array( 'default' => esc_attr( $techsmart_actual_options['header_cta_link_enabled'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_checkbox', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'header_cta_link_enabled', array( 'label' => __( 'Display CTA Button?', 'techsmart' ), 'type' => 'checkbox', 'section' => 'techsmart_header_settings', 'settings' => 'techsmart_options[header_cta_link_enabled]', ) ); $wp_customize->add_setting( 'techsmart_options[header_cta_link]', array( 'default' => esc_attr( $techsmart_actual_options['header_cta_link'] ), 'type' => 'option', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'header_cta_link', array( 'label' => __( 'Header CTA Button URL', 'techsmart' ), 'type' => 'url', 'section' => 'techsmart_header_settings', 'settings' => 'techsmart_options[header_cta_link]' ) ); // Add first image for header slider $wp_customize->add_setting( 'techsmart_options[slider_image_1]', array( 'default' => get_template_directory_uri() . '/images/slider_image_1.jpg', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'slider_image_1', array( 'label' => __('Upload First Slider Image', 'techsmart'), 'section' => 'techsmart_header_settings', 'settings' => 'techsmart_options[slider_image_1]', ) ) ); // Add second image for header slider $wp_customize->add_setting( 'techsmart_options[slider_image_2]', array( 'default' => get_template_directory_uri() . '/images/slider_image_2.jpg', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'slider_image_2', array( 'label' => __('Upload Second Slider Image', 'techsmart'), 'section' => 'techsmart_header_settings', 'settings' => 'techsmart_options[slider_image_2]', ) ) ); // Add third image for header slider $wp_customize->add_setting( 'techsmart_options[slider_image_3]', array( 'default' => get_template_directory_uri() . '/images/slider_image_3.jpg', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'slider_image_3', array( 'label' => __('Upload Third Slider Image', 'techsmart'), 'section' => 'techsmart_header_settings', 'settings' => 'techsmart_options[slider_image_3]', ) ) ); // Add fourth image for header slider $wp_customize->add_setting( 'techsmart_options[slider_image_4]', array( 'default' => get_template_directory_uri() . '/images/slider_image_4.jpg', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'slider_image_4', array( 'label' => __('Upload Fourth Slider Image', 'techsmart'), 'section' => 'techsmart_header_settings', 'settings' => 'techsmart_options[slider_image_4]', ) ) ); /* * Settings for services options * */ // Add services section to TechSmart option panel $wp_customize->add_section( 'techsmart_services_settings', array( 'title' => __( 'Our Services Section','techsmart' ), 'description' => __( 'Here you can manage the Services section options','techsmart' ), 'priority' => 25, 'panel' => 'techsmart_option_panel', 'capability' => 'edit_theme_options', ) ); // Services section enable $wp_customize->add_setting( 'techsmart_options[services_section_enabled]', array( 'default' => esc_attr( $techsmart_actual_options['services_section_enabled'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_checkbox', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_section_enabled', array( 'label' => __( 'Display Our Services Section?', 'techsmart' ), 'type' => 'checkbox', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_section_enabled]', ) ); // Services section title $wp_customize->add_setting( 'techsmart_options[services_title]', array( 'default' => esc_attr( $techsmart_actual_options['services_title'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_title', array( 'label' => __( 'Our Services Section Title', 'techsmart' ), 'type' => 'text', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_title]' ) ); // Services section tagline $wp_customize->add_setting( 'techsmart_options[services_tagline]', array( 'default' => esc_attr( $techsmart_actual_options['services_tagline'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_tagline', array( 'label' => __( 'Our Services section tagline', 'techsmart' ), 'type' => 'text', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_tagline]' ) ); /////// First service // Services section first service title $wp_customize->add_setting( 'techsmart_options[services_title_1]', array( 'default' => esc_attr( $techsmart_actual_options['services_title_1'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_title_1', array( 'label' => __( 'First Service Title', 'techsmart' ), 'type' => 'text', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_title_1]' ) ); // Services section first service icon $wp_customize->add_setting( 'techsmart_options[services_icon_1]', array( 'default' => esc_attr( $techsmart_actual_options['services_icon_1'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_icon_1', array( 'label' => __( 'First Service Font Awesome icon', 'techsmart' ), 'extra' => __( 'enter font awesome icon name
Example: fa fa-comments-o', 'techsmart' ), 'type' => 'text', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_icon_1]' ) ); // Services section first service text $wp_customize->add_setting( 'techsmart_options[services_text_1]', array( 'default' => esc_attr( $techsmart_actual_options['services_text_1'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_text_1', array( 'label' => __( 'First Service Text Content', 'techsmart' ), 'type' => 'textarea', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_text_1]' ) ); // Services section first service link $wp_customize->add_setting( 'techsmart_options[services_link_1]', array( 'default' => esc_attr( $techsmart_actual_options['services_link_1'] ), 'type' => 'option', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_link_1', array( 'label' => __( 'First Service Link', 'techsmart' ), 'type' => 'url', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_link_1]', ) ); /////// Second service // Services section second service title $wp_customize->add_setting( 'techsmart_options[services_title_2]', array( 'default' => esc_attr( $techsmart_actual_options['services_title_2'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_title_2', array( 'label' => __( 'Second Service Title', 'techsmart' ), 'type' => 'text', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_title_2]' ) ); // Services section second service icon $wp_customize->add_setting( 'techsmart_options[services_icon_2]', array( 'default' => esc_attr( $techsmart_actual_options['services_icon_2'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_icon_2', array( 'label' => __( 'Second Service Font Awesome icon', 'techsmart' ), 'extra' => __( 'enter font awesome icon name, example: fa fa-bell', 'techsmart' ), 'type' => 'text', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_icon_2]' ) ); // Services section second service text $wp_customize->add_setting( 'techsmart_options[services_text_2]', array( 'default' => esc_attr( $techsmart_actual_options['services_text_2'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_text_2', array( 'label' => __( 'Second Service Text Content', 'techsmart' ), 'type' => 'textarea', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_text_2]' ) ); // Services section second service link $wp_customize->add_setting( 'techsmart_options[services_link_2]', array( 'default' => esc_attr( $techsmart_actual_options['services_link_2'] ), 'type' => 'option', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_link_2', array( 'label' => __( 'Second Service Link', 'techsmart' ), 'type' => 'url', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_link_2]', ) ); /////// Third service // Services section third service title $wp_customize->add_setting( 'techsmart_options[services_title_3]', array( 'default' => esc_attr( $techsmart_actual_options['services_title_3'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_title_3', array( 'label' => __( 'Third Service Title', 'techsmart' ), 'type' => 'text', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_title_3]' ) ); // Services section third service icon $wp_customize->add_setting( 'techsmart_options[services_icon_3]', array( 'default' => esc_attr( $techsmart_actual_options['services_icon_3'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_icon_3', array( 'label' => __( 'Third Service Font Awesome icon', 'techsmart' ), 'extra' => __( 'enter font awesome icon name, example: fa fa-bell', 'techsmart' ), 'type' => 'text', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_icon_3]' ) ); // Services section third service text $wp_customize->add_setting( 'techsmart_options[services_text_3]', array( 'default' => esc_attr( $techsmart_actual_options['services_text_3'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_text_3', array( 'label' => __( 'Third Service Text Content', 'techsmart' ), 'type' => 'textarea', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_text_3]' ) ); // Services section third service link $wp_customize->add_setting( 'techsmart_options[services_link_3]', array( 'default' => esc_attr( $techsmart_actual_options['services_link_3'] ), 'type' => 'option', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_link_3', array( 'label' => __( 'Third Service Link', 'techsmart' ), 'type' => 'url', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_link_3]', ) ); /////// Fourth service // Services section fourth service title $wp_customize->add_setting( 'techsmart_options[services_title_4]', array( 'default' => esc_attr( $techsmart_actual_options['services_title_4'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_title_4', array( 'label' => __( 'Fourth Service Title', 'techsmart' ), 'type' => 'text', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_title_4]' ) ); // Services section fourth service icon $wp_customize->add_setting( 'techsmart_options[services_icon_4]', array( 'default' => esc_attr( $techsmart_actual_options['services_icon_4'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_icon_4', array( 'label' => __( 'Fourth Service Font Awesome icon', 'techsmart' ), 'extra' => __( 'enter font awesome icon name, example: fa fa-bell', 'techsmart' ), 'type' => 'text', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_icon_4]' ) ); // Services section fourth service text $wp_customize->add_setting( 'techsmart_options[services_text_4]', array( 'default' => esc_attr( $techsmart_actual_options['services_text_4'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_text_4', array( 'label' => __( 'Fourth Service Text Content', 'techsmart' ), 'type' => 'textarea', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_text_4]' ) ); // Services section fourth service link $wp_customize->add_setting( 'techsmart_options[services_link_4]', array( 'default' => esc_attr( $techsmart_actual_options['services_link_4'] ), 'type' => 'option', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'services_link_4', array( 'label' => __( 'Fourth Service Link', 'techsmart' ), 'type' => 'url', 'section' => 'techsmart_services_settings', 'settings' => 'techsmart_options[services_link_4]', ) ); /* * Settings for About Us options * */ // Add About Us section to TechSmart option panel $wp_customize->add_section( 'techsmart_about_settings', array( 'title' => __( 'About Us Section','techsmart' ), 'description' => __( 'Here you can manage the About Us section options','techsmart' ), 'priority' => 25, 'panel' => 'techsmart_option_panel', 'capability' => 'edit_theme_options', ) ); // About Us section enable $wp_customize->add_setting( 'techsmart_options[about_section_enabled]', array( 'default' => esc_attr( $techsmart_actual_options['about_section_enabled'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_checkbox', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'about_section_enabled', array( 'label' => __( 'Display About Us Section?', 'techsmart' ), 'type' => 'checkbox', 'section' => 'techsmart_about_settings', 'settings' => 'techsmart_options[about_section_enabled]', ) ); // About Us section title $wp_customize->add_setting( 'techsmart_options[about_section_title]', array( 'default' => esc_attr( $techsmart_actual_options['about_section_title'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'about_section_title_4', array( 'label' => __( 'About Us Section Title', 'techsmart' ), 'type' => 'text', 'section' => 'techsmart_about_settings', 'settings' => 'techsmart_options[about_section_title]' ) ); // About Us section text $wp_customize->add_setting( 'techsmart_options[about_section_text]', array( 'default' => esc_attr( $techsmart_actual_options['about_section_text'] ), 'type' => 'option', 'sanitize_callback' => 'techsmart_sanitize_text', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( 'about_section_text', array( 'label' => __( 'About Us Section Text Content', 'techsmart' ), 'type' => 'textarea', 'section' => 'techsmart_about_settings', 'settings' => 'techsmart_options[about_section_text]' ) ); // Add image for about us section $wp_customize->add_setting( 'techsmart_options[about_image]', array( 'default' => esc_attr( $techsmart_actual_options['about_image'] ), 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'about_image', array( 'label' => __('Upload About Us Image', 'techsmart'), 'section' => 'techsmart_about_settings', 'settings' => 'techsmart_options[about_image]', ) ) ); /* * Settings for standard sections * */ // Add color scheme setting and control. $wp_customize->add_setting( 'color_scheme', array( 'default' => 'default', 'sanitize_callback' => 'techsmart_sanitize_color_scheme', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'color_scheme', array( 'label' => __( 'Base Color Scheme', 'techsmart' ), 'section' => 'colors', 'type' => 'select', 'choices' => techsmart_get_color_scheme_choices(), 'priority' => 1, ) ); // Add page background color setting and control. $wp_customize->add_setting( 'second_background_color', array( 'default' => $color_scheme[1], 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'second_background_color', array( 'label' => __( 'Second Background Color', 'techsmart' ), 'section' => 'colors', ) ) ); // Add link color setting and control. $wp_customize->add_setting( 'accent_color', array( 'default' => $color_scheme[2], 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'accent_color', array( 'label' => __( 'Accent Color', 'techsmart' ), 'section' => 'colors', ) ) ); // Add main text color setting and control. $wp_customize->add_setting( 'main_text_color', array( 'default' => $color_scheme[3], 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'main_text_color', array( 'label' => __( 'Main Text Color', 'techsmart' ), 'section' => 'colors', ) ) ); // Add secondary text color setting and control. $wp_customize->add_setting( 'secondary_text_color', array( 'default' => $color_scheme[4], 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'secondary_text_color', array( 'label' => __( 'Secondary Text Color', 'techsmart' ), 'section' => 'colors', ) ) ); } add_action( 'customize_register', 'techsmart_customize_register', 11 ); /** * Render the site title for the selective refresh partial. * @see techsmart_customize_register() * * @return void */ function techsmart_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * @see techsmart_customize_register() * * @return void */ function techsmart_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Registers color schemes for technesmart. * * Can be filtered with {@see 'techsmart_color_schemes'}. * * The order of colors in a colors array: * 1. Background Color. * 2. Second Background Color. * 3. Accent Color. * 4. Main Text Color. * 5. Secondary Text Color. * * @return array An associative array of color scheme options. */ function techsmart_get_color_schemes() { /** * Filter the color schemes registered for use with technesmart. * * The default schemes include 'default', 'cadetblue', 'coral', 'purple', and 'crimson'. * * @param array $schemes { * Associative array of color schemes data. * * @type array $slug { * Associative array of information for setting up the color scheme. * * @type string $label Color scheme label. * @type array $colors HEX codes for default colors prepended with a hash symbol ('#'). * Colors are defined in the following order: Main background, page * background, link, main text, secondary text. * } * } */ return apply_filters( 'techsmart_color_schemes', array( 'default' => array( 'label' => __( 'Default', 'techsmart' ), 'colors' => array( '#ffffff', '#f2f2f2', '#03a7fc', '#1a1a1a', '#686868', ), ), 'dark' => array( 'label' => __( 'CadetBlue', 'techsmart' ), 'colors' => array( '#ffffff', '#f2f2f2', '#5f9ea0', '#1a1a1a', '#686868', ), ), 'gray' => array( 'label' => __( 'Coral', 'techsmart' ), 'colors' => array( '#ffffff', '#f2f2f2', '#ff7f50', '#1a1a1a', '#686868', ), ), 'red' => array( 'label' => __( 'Purple', 'techsmart' ), 'colors' => array( '#ffffff', '#f2f2f2', '#9370db', '#1a1a1a', '#686868', ), ), 'yellow' => array( 'label' => __( 'Crimson', 'techsmart' ), 'colors' => array( '#ffffff', '#f2f2f2', '#ed254d', '#1a1a1a', '#686868', ), ), ) ); } if ( ! function_exists( 'techsmart_get_color_scheme' ) ) : /** * Retrieves the current technesmart color scheme. * * Create your own techsmart_get_color_scheme() function to override in a child theme. * * @return array An associative array of either the current or default color scheme HEX values. */ function techsmart_get_color_scheme() { $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); $color_schemes = techsmart_get_color_schemes(); if ( array_key_exists( $color_scheme_option, $color_schemes ) ) { return $color_schemes[ $color_scheme_option ]['colors']; } return $color_schemes['default']['colors']; } endif; // techsmart_get_color_scheme if ( ! function_exists( 'techsmart_get_color_scheme_choices' ) ) : /** * Retrieves an array of color scheme choices registered for technesmart. * * Create your own techsmart_get_color_scheme_choices() function to override * in a child theme. * * @return array Array of color schemes. */ function techsmart_get_color_scheme_choices() { $color_schemes = techsmart_get_color_schemes(); $color_scheme_control_options = array(); foreach ( $color_schemes as $color_scheme => $value ) { $color_scheme_control_options[ $color_scheme ] = $value['label']; } return $color_scheme_control_options; } endif; // techsmart_get_color_scheme_choices if ( ! function_exists( 'techsmart_sanitize_color_scheme' ) ) : /** * Handles sanitization for technesmart color schemes. * * Create your own techsmart_sanitize_color_scheme() function to override * in a child theme. * * @param string $value Color scheme name value. * @return string Color scheme name. */ function techsmart_sanitize_color_scheme( $value ) { $color_schemes = techsmart_get_color_scheme_choices(); if ( ! array_key_exists( $value, $color_schemes ) ) { return 'default'; } return $value; } endif; // techsmart_sanitize_color_scheme /** * Enqueues front-end CSS for color scheme. * * @see wp_add_inline_style() */ function techsmart_color_scheme_css() { $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); // Don't do anything if the default color scheme is selected. if ( 'default' === $color_scheme_option ) { return; } $color_scheme = techsmart_get_color_scheme(); // Convert main text hex color to rgba. $color_textcolor_rgb = techsmart_hex2rgb( $color_scheme[3] ); // If the rgba values are empty return early. if ( empty( $color_textcolor_rgb ) ) { return; } // If we get this far, we have a custom color scheme. $colors = array( 'background_color' => $color_scheme[0], 'second_background_color' => $color_scheme[1], 'accent_color' => $color_scheme[2], 'main_text_color' => $color_scheme[3], 'secondary_text_color' => $color_scheme[4], 'border_color' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.2)', $color_textcolor_rgb ), ); $color_scheme_css = techsmart_get_color_scheme_css( $colors ); wp_add_inline_style( 'techsmart-style', $color_scheme_css ); } add_action( 'wp_enqueue_scripts', 'techsmart_color_scheme_css' ); /** * Binds the JS listener to make Customizer color_scheme control. * * Passes color scheme data as techsmart_colorScheme global. */ function techsmart_customize_control_js() { wp_enqueue_script( 'color-scheme-control', get_template_directory_uri() . '/js/color-scheme-control.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), '20160412', true ); wp_localize_script( 'color-scheme-control', 'techsmart_colorScheme', techsmart_get_color_schemes() ); } add_action( 'customize_controls_enqueue_scripts', 'techsmart_customize_control_js' ); /** * Binds JS handlers to make the Customizer preview reload changes asynchronously. * */ function techsmart_customize_preview_js() { wp_enqueue_script( 'techsmart-customize-preview', get_template_directory_uri() . '/js/customize-preview.js', array( 'customize-preview' ), '20160605', true ); } add_action( 'customize_preview_init', 'techsmart_customize_preview_js' ); /** * Returns CSS for the color schemes. * * @param array $colors Color scheme colors. * @return string Color scheme CSS. */ function techsmart_get_color_scheme_css( $colors ) { $colors = wp_parse_args( $colors, array( 'background_color' => '', 'second_background_color' => '', 'accent_color' => '', 'main_text_color' => '', 'secondary_text_color' => '', 'border_color' => '', ) ); return << a:hover, .main-navigation .menu-item > a:focus, .main-navigation .current-menu-item > a, .main-navigation .current-menu-ancestor > a { color: {$colors['accent_color']}; border-color: {$colors['accent_color']}; } .main-navigation .menu-item > a, .main-navigation .menu-item .sub-menu .menu-item > a { border-color: {$colors['background_color']}; } mark, ins, button:hover, button:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="reset"]:hover, input[type="reset"]:focus, input[type="submit"]:hover, input[type="submit"]:focus, .pagination .prev:hover, .pagination .prev:focus, .pagination .next:hover, .pagination .next:focus, .widget_calendar tbody a, .page-links a:hover, .page-links a:focus { background-color: {$colors['main_text_color']}; border-color: {$colors['accent_color']}; color: {$colors['accent_color']}; } .button-link, .comment-reply-link { background-color: {$colors['accent_color']}; border-color: {$colors['accent_color']}; color: {$colors['background_color']}; } .font-awesome-service-icon { background-color: {$colors['background_color']}; border-color: {$colors['accent_color']}; } .button-link:hover, .button-link:focus, .comment-reply-link:hover, .comment-reply-link:focus { background-color: {$colors['main_text_color']}; border-color: {$colors['accent_color']}; color: {$colors['accent_color']}; } input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="search"], textarea, .tagcloud a, .tagcloud a, .menu-toggle, .menu-toggle { border-color: {$colors['accent_color']}; } .recent-posts-title a:hover, .recent-posts-title a:focus{ color: {$colors['accent_color']}; } #secondary .widget-title::after { background-color: {$colors['accent_color']}; } .entry-footer > span:not(:last-child):after, .entry-header > span:not(:last-child):after { color: {$colors['accent_color']}; } /* Main Text Color */ body, blockquote cite, blockquote small, .main-navigation a, .menu-toggle, .dropdown-toggle, .social-navigation a, .post-navigation a, .pagination a:hover, .pagination a:focus, .widget-title a, .site-branding .site-title a, .entry-title a, .page-links > .page-links-title, .comment-author, .comment-reply-title small a:hover, .comment-reply-title small a:focus { color: {$colors['main_text_color']}; } blockquote, .menu-toggle.toggled-on, .menu-toggle.toggled-on:hover, .menu-toggle.toggled-on:focus, .post-navigation, .post-navigation div + div, .pagination, .widget, .page-header, .page-links a, .comments-title, .comment-reply-title { border-color: {$colors['main_text_color']}; } ul.social-icons li a:hover, ul.social-icons li a:focus { background-color: {$colors['main_text_color']}; } .recent-posts-title a { color: {$colors['main_text_color']}; } /* Secondary Text Color */ /** * IE8 and earlier will drop any block with CSS3 selectors. * Do not combine these styles with the next block. */ body:not(.search-results) .entry-summary { color: {$colors['secondary_text_color']}; } blockquote, .post-password-form label, a:hover, a:focus, a:active, .post-navigation .meta-nav, .image-navigation, .comment-navigation, .widget_recent_entries .post-date, .widget_rss .rss-date, .widget_rss cite, .site-description, .author-bio, .entry-footer, .entry-footer a, .entry-header, .entry-header a, .sticky-post, .taxonomy-description, .entry-caption, .comment-metadata, .pingback .edit-link, .comment-metadata a, .pingback .comment-edit-link, .comment-form label, .comment-notes, .comment-awaiting-moderation, .logged-in-as, .form-allowed-tags, .site-info, .site-info a, .wp-caption .wp-caption-text, .gallery-caption, .widecolumn label, .widecolumn .mu_register label { color: {$colors['secondary_text_color']}; } .widget_calendar tbody a:hover, .widget_calendar tbody a:focus { background-color: {$colors['secondary_text_color']}; } /* Border Color */ fieldset, pre, abbr, acronym, table, th, td, .menu-toggle, .dropdown-toggle:after, .social-navigation a, .image-navigation, .comment-navigation, .tagcloud a, .entry-content, .entry-summary, .page-links a, .page-links > span, .comment-list article, .comment-list .pingback, .comment-list .trackback, .comment-reply-link, .no-comments, .widecolumn .mu_register .mu_alert { border-color: {$colors['main_text_color']}; /* Fallback for IE7 and IE8 */ border-color: {$colors['border_color']}; } hr, code { background-color: {$colors['main_text_color']}; /* Fallback for IE7 and IE8 */ background-color: {$colors['border_color']}; } input[type="text"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="number"]:focus, textarea:focus, input[type="text"]:hover, input[type="email"]:hover, input[type="url"]:hover, input[type="password"]:hover, input[type="search"]:hover, input[type="tel"]:hover, input[type="number"]:hover, textarea:hover, input[type="text"]:active, input[type="email"]:active, input[type="url"]:active, input[type="password"]:active, input[type="search"]:active, input[type="tel"]:active, input[type="number"]:active, textarea:active { border-color: {$colors['secondary_text_color']}; } .comments-title, .comment-reply-title { border-color: {$colors['secondary_text_color']}; } @media screen and (min-width: 62rem) { .main-navigation li:hover > a, .main-navigation li.focus > a { color: {$colors['accent_color']}; } .main-navigation .sub-menu { border-color: {$colors['main_text_color']}; } .main-navigation ul ul, .main-navigation ul ul li { background-color: {$colors['background_color']}; border-color: {$colors['background_color']}; } .main-navigation ul ul:before { border-top-color: {$colors['main_text_color']}; border-bottom-color: {$colors['main_text_color']}; } .main-navigation ul ul li { background-color: {$colors['background_color']}; } .main-navigation ul ul:after { border-top-color: {$colors['background_color']}; border-bottom-color: {$colors['background_color']}; } } CSS; } /** * Outputs an Underscore template for generating CSS for the color scheme. * * The template generates the css dynamically for instant display in the * Customizer preview. */ function techsmart_color_scheme_css_template() { $colors = array( 'background_color' => '{{ data.background_color }}', 'second_background_color' => '{{ data.second_background_color }}', 'accent_color' => '{{ data.accent_color }}', 'main_text_color' => '{{ data.main_text_color }}', 'secondary_text_color' => '{{ data.secondary_text_color }}', 'border_color' => '{{ data.border_color }}', ); ?> a, .main-navigation .menu-item .sub-menu .menu-item > a { border-color: #%1$s; } } .main-navigation .sub-menu { background-color: #%1$s; } .main-navigation .menu-item .sub-menu .menu-item > a { border-color: #%1$s; } '; wp_add_inline_style( 'techsmart-style', wp_strip_all_tags( sprintf( $css, $background_color ) ) ); } add_action( 'wp_enqueue_scripts', 'techsmart_background_color_css', 11 ); /** * Enqueues front-end CSS for the second background color. * * @see wp_add_inline_style() */ function techsmart_second_background_color_css() { $color_scheme = techsmart_get_color_scheme(); $default_color = $color_scheme[1]; $second_background_color = get_theme_mod( 'second_background_color', $default_color ); // Don't do anything if the current color is the default. if ( $second_background_color === $default_color ) { return; } $css = ' /* Custom Second Background Color */ #services, #recent-posts { background-color: %1$s; } .topbar-wrapper { background-color: %1$s; } '; wp_add_inline_style( 'techsmart-style', wp_strip_all_tags( sprintf( $css, $second_background_color ) ) ); } add_action( 'wp_enqueue_scripts', 'techsmart_second_background_color_css', 11 ); /** * Enqueues front-end CSS for the link color. * * @see wp_add_inline_style() */ function techsmart_accent_color_css() { $color_scheme = techsmart_get_color_scheme(); $default_color = $color_scheme[2]; $accent_color = get_theme_mod( 'accent_color', $default_color ); // Don't do anything if the current color is the default. if ( $accent_color === $default_color ) { return; } $css = ' /* Custom Accent Color */ .menu-toggle:hover, .menu-toggle:focus, a, .main-navigation a:hover, .main-navigation a:focus, .dropdown-toggle:hover, .dropdown-toggle:focus, .social-navigation a:hover:before, .social-navigation a:focus:before, .post-navigation a:hover .post-title, .post-navigation a:focus .post-title, .tagcloud a:hover, .tagcloud a:focus, .site-branding .site-title a:hover, .site-branding .site-title a:focus, .entry-title a:hover, .entry-title a:focus, .entry-footer a:hover, .entry-footer a:focus, .entry-header a:hover, .entry-header a:focus, .comment-metadata a:hover, .comment-metadata a:focus, .pingback .comment-edit-link:hover, .pingback .comment-edit-link:focus, .required, .site-info a:hover, .site-info a:focus { color: %1$s; } button, button[disabled]:hover, button[disabled]:focus, input[type="button"], input[type="button"][disabled]:hover, input[type="button"][disabled]:focus, input[type="reset"], input[type="reset"][disabled]:hover, input[type="reset"][disabled]:focus, input[type="submit"], input[type="submit"][disabled]:hover, input[type="submit"][disabled]:focus, .menu-toggle.toggled-on, .menu-toggle.toggled-on:hover, .menu-toggle.toggled-on:focus, .pagination .prev, .pagination .next, .page-links a { background-color: %1$s; border-color: %1$s; } input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="search"], textarea, .tagcloud a:hover, .tagcloud a:focus, .menu-toggle:hover, .menu-toggle:focus { border-color: %1$s; } .font-awesome-service-icon { border-color: %1$s; } mark, ins, button:hover, button:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="reset"]:hover, input[type="reset"]:focus, input[type="submit"]:hover, input[type="submit"]:focus, .pagination .prev:hover, .pagination .prev:focus, .pagination .next:hover, .pagination .next:focus, .widget_calendar tbody a, .page-links a:hover, .page-links a:focus { border-color: %1$s; color: %1$s; } .page-title-wrapper, ul.social-icons li a, .separator-1 { background-color: %1$s; } i.phone, ul.social-icons li a, .header-cta, .section-title, .font-awesome-service-icon, .site-footer .widget-title { color: %1$s; } .main-navigation .menu-item > a:hover, .main-navigation .menu-item > a:focus, .main-navigation .current-menu-item > a, .main-navigation .current-menu-ancestor > a { color: %1$s; border-color: %1$s; } .button-link, .comment-reply-link { background-color: %1$s; border-color: %1$s; } .button-link:hover, .button-link:focus, .comment-reply-link:hover, .comment-reply-link:focus { border-color: %1$s; color: %1$s; } .recent-posts-title a:hover, .recent-posts-title a:focus { color: %1$s; } #secondary .widget-title::after { background-color: %1$s; } .entry-footer > span:not(:last-child):after, .entry-header > span:not(:last-child):after { color: %1$s; } @media screen and (min-width: 62rem) { .main-navigation li:hover > a, .main-navigation li.focus > a { color: %1$s; } } '; wp_add_inline_style( 'techsmart-style', wp_strip_all_tags( sprintf( $css, $accent_color ) ) ); } add_action( 'wp_enqueue_scripts', 'techsmart_accent_color_css', 11 ); /** * Enqueues front-end CSS for the main text color. * * @see wp_add_inline_style() */ function techsmart_main_text_color_css() { $color_scheme = techsmart_get_color_scheme(); $default_color = $color_scheme[3]; $main_text_color = get_theme_mod( 'main_text_color', $default_color ); // Don't do anything if the current color is the default. if ( $main_text_color === $default_color ) { return; } // Convert main text hex color to rgba. $main_text_color_rgb = techsmart_hex2rgb( $main_text_color ); // If the rgba values are empty return early. if ( empty( $main_text_color_rgb ) ) { return; } // If we get this far, we have a custom color scheme. $border_color = vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.2)', $main_text_color_rgb ); $css = ' /* Custom Main Text Color */ body, blockquote cite, blockquote small, .main-navigation a, .menu-toggle, .dropdown-toggle, .social-navigation a, .post-navigation a, .pagination a:hover, .pagination a:focus, .widget-title a, .site-branding .site-title a, .entry-title a, .page-links > .page-links-title, .comment-author, .comment-reply-title small a:hover, .comment-reply-title small a:focus { color: %1$s } blockquote, .menu-toggle.toggled-on, .menu-toggle.toggled-on:hover, .menu-toggle.toggled-on:focus, .post-navigation, .post-navigation div + div, .pagination, .widget, .page-header, .page-links a, .comments-title, .comment-reply-title { border-color: %1$s; } mark, ins, button:hover, button:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="reset"]:hover, input[type="reset"]:focus, input[type="submit"]:hover, input[type="submit"]:focus, .pagination .prev:hover, .pagination .prev:focus, .pagination .next:hover, .pagination .next:focus, .widget_calendar tbody a, .page-links a:hover, .page-links a:focus { background-color: %1$s; } .recent-posts-title a { color: %1$s; } /* Border Color */ fieldset, pre, abbr, acronym, table, th, td, .main-navigation li, .main-navigation .primary-menu, .menu-toggle, .dropdown-toggle:after, .image-navigation, .comment-navigation, .tagcloud a, .entry-content, .entry-summary, .page-links a, .page-links > span, .comment-list article, .comment-list .pingback, .comment-list .trackback, .no-comments, .widecolumn .mu_register .mu_alert { border-color: %1$s; /* Fallback for IE7 and IE8 */ border-color: %2$s; } hr, code { background-color: %1$s; /* Fallback for IE7 and IE8 */ background-color: %2$s; } ul.social-icons li a:hover, ul.social-icons li a:focus { background-color: %1$s; } .button-link:hover, .button-link:focus, .comment-reply-link:hover, .comment-reply-link:focus { background-color: %1$s; } @media screen and (min-width: 62rem) { .main-navigation ul, .main-navigation .sub-menu { border-color: %1$s; } .main-navigation ul ul:before { border-top-color: %1$s; border-bottom-color: %1$s; } } '; wp_add_inline_style( 'techsmart-style', wp_strip_all_tags( sprintf( $css, $main_text_color, $border_color ) ) ); } add_action( 'wp_enqueue_scripts', 'techsmart_main_text_color_css', 11 ); /** * Enqueues front-end CSS for the secondary text color. * * @see wp_add_inline_style() */ function techsmart_secondary_text_color_css() { $color_scheme = techsmart_get_color_scheme(); $default_color = $color_scheme[4]; $secondary_text_color = get_theme_mod( 'secondary_text_color', $default_color ); // Don't do anything if the current color is the default. if ( $secondary_text_color === $default_color ) { return; } $css = ' /* Custom Secondary Text Color */ /** * IE8 and earlier will drop any block with CSS3 selectors. * Do not combine these styles with the next block. */ body:not(.search-results) .entry-summary { color: %1$s; } blockquote, .post-password-form label, a:hover, a:focus, a:active, .post-navigation .meta-nav, .image-navigation, .comment-navigation, .widget_recent_entries .post-date, .widget_rss .rss-date, .widget_rss cite, .site-description, .author-bio, .entry-footer, .entry-footer a, .entry-header, .entry-header a, .sticky-post, .taxonomy-description, .entry-caption, .comment-metadata, .pingback .edit-link, .comment-metadata a, .pingback .comment-edit-link, .comment-form label, .comment-notes, .comment-awaiting-moderation, .logged-in-as, .form-allowed-tags, .site-info, .site-info a, .wp-caption .wp-caption-text, .gallery-caption, .widecolumn label, .widecolumn .mu_register label { color: %1$s; } .widget_calendar tbody a:hover, .widget_calendar tbody a:focus { background-color: %1$s; } input[type="text"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="number"]:focus, textarea:focus, input[type="text"]:hover, input[type="email"]:hover, input[type="url"]:hover, input[type="password"]:hover, input[type="search"]:hover, input[type="tel"]:hover, input[type="number"]:hover, textarea:hover, input[type="text"]:active, input[type="email"]:active, input[type="url"]:active, input[type="password"]:active, input[type="search"]:active, input[type="tel"]:active, input[type="number"]:active, textarea:active { border-color: %1$s; } .comments-title, .comment-reply-title { border-color: %1$s; } '; wp_add_inline_style( 'techsmart-style', wp_strip_all_tags( sprintf( $css, $secondary_text_color ) ) ); } add_action( 'wp_enqueue_scripts', 'techsmart_secondary_text_color_css', 11 ); /** * Enqueues front-end CSS for typography * * @see wp_add_inline_style() */ function techsmart_typography() { $typography_css = techsmart_get_typography_css(); wp_add_inline_style( 'techsmart-style', $typography_css ); } add_action( 'wp_enqueue_scripts', 'techsmart_typography', 11 ); /** * Returns CSS for typography. * * @return string typography CSS. */ function techsmart_get_typography_css() { $techsmart_typography_settings = techsmart_settings(); return << 100 ) $value = 100; return $value; } /* class for font-family */ if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'techsmart_font_control' ) ) : class techsmart_font_control extends WP_Customize_Control { public function render_content() { ?> label ); ?> 'Open Sans', 'header_font_size' => '34', 'body_font' => 'PT Sans', 'body_font_size' => '16', 'menu_font' => 'Fira Sans', 'menu_font_size' => '16', 'section_titles_font' => 'Karla', 'section_titles_font_size' => '32', 'section_subtitles_font' => 'Open Sans', 'section_subtitles_font_size' => '20', 'phone' => '+01 6900 123456', 'facebook_link_enabled' => 'on', 'facebook_link' => '#', 'twitter_link_enabled' => 'on', 'twitter_link' => '#', 'googleplus_link_enabled' => 'on', 'googleplus_link' => '#', 'instagram_link_enabled' => 'on', 'instagram_link' => '#', 'linkedin_link_enabled' => 'on', 'linkedin_link' => '#', 'header_cta_text' => 'Beautiful Design and' . "\r\n" . 'Awesome Features', 'header_cta_link_enabled' => 'on', 'header_cta_link' => '#', 'slider_image_1' => get_template_directory_uri().'/images/slider_image_1.jpg', 'slider_image_2' => get_template_directory_uri().'/images/slider_image_2.jpg', 'slider_image_3' => get_template_directory_uri().'/images/slider_image_3.jpg', 'slider_image_4' => get_template_directory_uri().'/images/slider_image_4.jpg', 'services_section_enabled' => 'on', 'services_title' => 'Services', 'services_tagline' => 'We are Simple Builder, your new business partner', 'services_title_1' => 'Web Development', 'services_icon_1' => 'fa fa-comments-o', 'services_text_1' => 'Lorem ipsum dolor sit amet.', 'services_link_1' => '#', 'services_title_2' => 'Advertising', 'services_icon_2' => 'fa fa-life-ring', 'services_text_2' => 'Lorem ipsum dolor sit amet.', 'services_link_2' => '#', 'services_title_3' => 'Attractive Design', 'services_icon_3' => 'fa fa-lightbulb-o', 'services_text_3' => 'Lorem ipsum dolor sit amet.', 'services_link_3' => '#', 'services_title_4' => 'Responsive Site', 'services_icon_4' => 'fa fa-desktop', 'services_text_4' => 'Lorem ipsum dolor sit amet.', 'services_link_4' => '#', 'about_section_enabled' => 'on', 'about_section_title' => 'Hello and Welcome', 'about_section_text' => 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu.

In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus.', 'about_image' => get_template_directory_uri().'/images/about_image.jpg', ); return wp_parse_args(get_option('techsmart_options', array()), $techsmart_defaults); }