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' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Header', 'clubhair' ), 'id' => 'header-sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Services Title', 'clubhair' ), 'id' => 'services_title_sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Service 1', 'clubhair' ), 'id' => 'service_sidebar_1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Service 2', 'clubhair' ), 'id' => 'service_sidebar_2', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Service 3', 'clubhair' ), 'id' => 'service_sidebar_3', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Service 4', 'clubhair' ), 'id' => 'service_sidebar_4', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Blog Title', 'clubhair' ), 'id' => 'blog_title_sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Contact', 'clubhair' ), 'id' => 'contact_sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Prices Title', 'clubhair' ), 'id' => 'prices_title_sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Prices 1', 'clubhair' ), 'id' => 'price_sidebar_1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Prices 2', 'clubhair' ), 'id' => 'price_sidebar_2', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Prices 3', 'clubhair' ), 'id' => 'price_sidebar_3', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Stats Title', 'clubhair' ), 'id' => 'stats_title_sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Stats 1', 'clubhair' ), 'id' => 'stats_sidebar_1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Stats 2', 'clubhair' ), 'id' => 'stats_sidebar_2', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Stats 3', 'clubhair' ), 'id' => 'stats_sidebar_3', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Stats 4', 'clubhair' ), 'id' => 'stats_sidebar_4', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Front page: Information', 'clubhair' ), 'id' => 'information_sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'clubhair_widgets_init' ); /** * Post Read More * * @param array $link Show more link. */ function clubhair_excerpt_more( $link ) { if ( is_admin() ) { return $link; } $link = sprintf( '', esc_url( get_permalink( get_the_ID() ) ), // translators: %s containing the title of the post or page. sprintf( __( 'Continue reading "%s"', 'clubhair' ), get_the_title( get_the_ID() ) ) ); return ' … ' . $link; } add_filter( 'excerpt_more', 'clubhair_excerpt_more' ); /** * Bootstrap Images img-responsive * * @param array $html Html code for image with Bootstrap class. */ function clubhair_bootstrap_responsive_images( $html ) { $classes = 'img-responsive'; if ( preg_match( '/)/', '$1 ' . $classes . ' $2', $html ); } else { $html = preg_replace( '/()/', '$1 class="' . $classes . '" $2', $html ); } return $html; } add_filter( 'the_content','clubhair_bootstrap_responsive_images',10 ); add_filter( 'post_thumbnail_html', 'clubhair_bootstrap_responsive_images', 10 ); /** * Comment Reply */ function clubhair_comment_reply() { if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'clubhair_comment_reply' ); /** * Bootstrap Comment Form * * @param array $clubhair_fields Comment Form Fields. */ function clubhair_comment_form_fields( $clubhair_fields ) { $clubhair_commenter = wp_get_current_commenter(); $clubhair_req = get_option( 'require_name_email' ); $clubhair_aria_req = ( $clubhair_req ? " aria-required='true'" : '' ); $clubhair_html5 = current_theme_supports( 'html5', 'comment-form' ) ? 1 : 0; $clubhair_fields = array( 'author' => '
', 'email' => '', 'url' => '
', ); return $clubhair_fields; } add_filter( 'comment_form_default_fields', 'clubhair_comment_form_fields' ); /** * Bootstrap Comment Form * * @param array $clubhair_args Comment Form Fields. */ function clubhair_comment_form( $clubhair_args ) { $clubhair_args['comment_field'] = '
'; $clubhair_args['class_submit'] = 'btn btn-default btn-submit'; return $clubhair_args; } add_filter( 'comment_form_defaults', 'clubhair_comment_form' ); ?>