215, 'height' => 38, 'flex-width' => true, 'flex-height' => true, 'header-text' => array( 'site-title', 'site-description' ), ) ); // Featured Image. add_theme_support( 'post-thumbnails' ); // Language Support. load_theme_textdomain( 'clubhair', get_template_directory() . '/languages' ); // Header Image. $clubhair_args = array( 'flex-width' => true, 'width' => 1500, 'flex-height' => true, 'height' => 900, 'default-text-color' => '#fff', ); add_theme_support( 'custom-header', $clubhair_args ); // Content Width. if ( ! isset( $content_width ) ) { $content_width = 1170; } } add_action( 'after_setup_theme', 'clubhair_setup' ); /** * Color / Social Customizer * * @param array $clubhair_wp_customize Theme Colors & Social Media. */ function clubhair_customize_register( $clubhair_wp_customize ) { $clubhair_colors = array(); $clubhair_colors[] = array( 'slug' => 'default_color', 'default' => '#c59d5f', 'label' => __( 'Default Color ', 'clubhair' ), ); foreach ( $clubhair_colors as $clubhair_color ) { $clubhair_wp_customize->add_setting( $clubhair_color['slug'], array( 'default' => $clubhair_color['default'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_hex_color', ) ); $clubhair_wp_customize->add_control( new WP_Customize_Color_Control( $clubhair_wp_customize, $clubhair_color['slug'], array( 'label' => $clubhair_color['label'], 'section' => 'colors', 'settings' => $clubhair_color['slug'], ) ) ); } $clubhair_wp_customize->add_panel( 'widget_images', array( 'priority' => 70, 'theme_supports' => '', 'title' => __( 'Widget Images', 'clubhair' ), 'description' => __( 'Set background images for certain widgets.', 'clubhair' ), ) ); $clubhair_wp_customize->add_section( 'information_background' , array( 'title' => __( 'Information Background','clubhair' ), 'panel' => 'widget_images', 'priority' => 20, ) ); $clubhair_wp_customize->add_section( 'contact_background' , array( 'title' => __( 'Contact Background','clubhair' ), 'panel' => 'widget_images', 'priority' => 20, ) ); $clubhair_wp_customize->add_setting( 'information_bg', array( 'flex-width' => true, 'width' => 1500, 'flex-height' => true, 'height' => 900, ) ); $clubhair_wp_customize->add_setting( 'contact_bg', array( 'flex-width' => true, 'width' => 1500, 'flex-height' => true, 'height' => 900, ) ); $clubhair_wp_customize->add_control( new WP_Customize_Image_Control( $clubhair_wp_customize, 'information_background_image', array( 'label' => __( 'Add Information Background Here, the width should be approx 1500px', 'clubhair' ), 'section' => 'information_background', 'settings' => 'information_bg', ) ) ); $clubhair_wp_customize->add_control( new WP_Customize_Image_Control( $clubhair_wp_customize, 'contact_background_image', array( 'label' => __( 'Add Contact Background Here, the width should be approx 1500px', 'clubhair' ), 'section' => 'contact_background', 'settings' => 'contact_bg', ) ) ); $clubhair_wp_customize->add_section( 'sociallinks', array( 'title' => __( 'Social Links','clubhair' ), 'description' => __( 'Add Your Social Links Here.','clubhair' ), 'priority' => '900', ) ); $clubhair_wp_customize->add_setting( 'clubhair_facebooklink', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $clubhair_wp_customize->add_control( 'clubhair_facebooklink', array( 'label' => __( 'Facebook URL', 'clubhair' ), 'section' => 'sociallinks', ) ); $clubhair_wp_customize->add_setting( 'clubhair_twitterlink', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $clubhair_wp_customize->add_control( 'clubhair_twitterlink', array( 'label' => __( 'Twitter URL', 'clubhair' ), 'section' => 'sociallinks', ) ); $clubhair_wp_customize->add_setting( 'clubhair_pinterestlink', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $clubhair_wp_customize->add_control( 'clubhair_pinterestlink', array( 'label' => __( 'Pinterest URL', 'clubhair' ), 'section' => 'sociallinks', ) ); $clubhair_wp_customize->add_setting( 'clubhair_instagramlink', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $clubhair_wp_customize->add_control( 'clubhair_instagramlink', array( 'label' => __( 'Instagram URL', 'clubhair' ), 'section' => 'sociallinks', ) ); $clubhair_wp_customize->add_setting( 'clubhair_linkedinlink', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $clubhair_wp_customize->add_control( 'clubhair_linkedinlink', array( 'label' => __( 'LinkedIn URL', 'clubhair' ), 'section' => 'sociallinks', ) ); $clubhair_wp_customize->add_setting( 'clubhair_googlepluslink', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $clubhair_wp_customize->add_control( 'clubhair_googlepluslink', array( 'label' => __( 'Google+ URL', 'clubhair' ), 'section' => 'sociallinks', ) ); $clubhair_wp_customize->add_setting( 'clubhair_youtubelink', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $clubhair_wp_customize->add_control( 'clubhair_youtubelink', array( 'label' => __( 'YouTube URL', 'clubhair' ), 'section' => 'sociallinks', ) ); $clubhair_wp_customize->add_setting( 'clubhair_vimeo', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $clubhair_wp_customize->add_control( 'clubhair_vimeo', array( 'label' => __( 'Vimeo URL', 'clubhair' ), 'section' => 'sociallinks', ) ); $clubhair_wp_customize->add_setting( 'clubhair_tumblrlink', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $clubhair_wp_customize->add_control( 'clubhair_tumblrlink', array( 'label' => __( 'Tumblr URL', 'clubhair' ), 'section' => 'sociallinks', ) ); $clubhair_wp_customize->add_setting( 'clubhair_flickrlink', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $clubhair_wp_customize->add_control( 'clubhair_flickrlink', array( 'label' => __( 'Flickr URL', 'clubhair' ), 'section' => 'sociallinks', ) ); } add_action( 'customize_register', 'clubhair_customize_register' ); /** * Includes Plugin Admin */ include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); /** * Bootstrap 3.3.7 */ function clubhair_bootstrap() { wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css' ); wp_enqueue_style( 'fontawesome', get_template_directory_uri() . '/css/fontawesome-all.min.css' ); wp_enqueue_style( 'clubhair-googlefonts', clubhair_google_fonts_url(), array(), null ); wp_enqueue_style( 'clubhair-style', get_stylesheet_uri() ); wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ), '', true ); wp_enqueue_script( 'clubhair-script', get_template_directory_uri() . '/js/script.js', array( 'jquery' ), '', true ); } add_action( 'wp_enqueue_scripts', 'clubhair_bootstrap' ); /** * Google Font */ function clubhair_google_fonts_url() { $font_families = array( 'Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i' ); $query_args = array( 'family' => rawurlencode( implode( '|', $font_families ) ), 'subset' => rawurlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, '//fonts.googleapis.com/css' ); return apply_filters( 'clubhair_google_fonts_url', $fonts_url ); } /** * Navigation */ function clubhair_register_menu() { register_nav_menus( array( 'primary' => esc_html__( 'Top Primary Menu', 'clubhair' ), ) ); } add_action( 'init', 'clubhair_register_menu' ); /** * Bootstrap Navigation */ function clubhair_bootstrap_menu() { wp_nav_menu(array( 'theme_location' => 'primary', 'depth' => 2, 'menu_class' => 'nav navbar-nav', 'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback', 'walker' => new WP_Bootstrap_Navwalker(), )); } require get_template_directory() . '/inc/class-wp-bootstrap-navwalker.php'; /** * WooCommerce Support */ function clubhair_woocommerce_support() { add_theme_support( 'woocommerce' ); } add_action( 'after_setup_theme', 'clubhair_woocommerce_support' ); remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display', 10 ); add_action( 'woocommerce_after_cart', 'woocommerce_cross_sell_display', 10 ); /** * WooCommerce Cart Count */ function clubhair_woocommerce_cart_count() { if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) { $clubhair_count = WC()->cart->cart_contents_count; ?> 0 ) { ?> cart->cart_contents_count; ?> 0 ) { ?> .site-title, .site-description { position: absolute!important; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px); } '; } } add_action( 'wp_head', 'clubhair_header_style' ); /** * Custom Colors */ function clubhair_customizer_css() { $clubhair_default_color = get_theme_mod( 'default_color' ); $clubhair_header_text_color = get_header_textcolor(); $clubhair_information_background = get_theme_mod( 'information_bg' ); $clubhair_contact_background = get_theme_mod( 'contact_bg' ); ?> __( 'Primary Sidebar', 'clubhair' ), 'id' => 'primary_sidebar', 'before_widget' => '
', 'before_title' => '