'ffffff',
));
add_image_size( 'beauty-hair-salon-featured-image', 2000, 1200, true );
add_image_size( 'beauty-hair-salon-thumbnail-avatar', 100, 100, true );
$GLOBALS['content_width'] = 525;
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'beauty-hair-salon' ),
) );
add_theme_support( 'html5', array(
'comment-form',
'comment-list',
'gallery',
'caption',
) );
// Add theme support for Custom Logo.
add_theme_support( 'custom-logo', array(
'width' => 250,
'height' => 250,
'flex-width' => true,
'flex-height' => true,
) );
/*
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, and column width.
*/
add_editor_style( array( 'assets/css/editor-style.css') );
}
add_action( 'after_setup_theme', 'beauty_hair_salon_setup' );
// widgets
function beauty_hair_salon_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'beauty-hair-salon' ),
'id' => 'sidebar-1',
'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'beauty-hair-salon' ),
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Page Sidebar', 'beauty-hair-salon' ),
'id' => 'sidebar-2',
'description' => __( 'Add widgets here to appear in your pages and posts', 'beauty-hair-salon' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Sidebar 3', 'beauty-hair-salon' ),
'id' => 'sidebar-3',
'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'beauty-hair-salon' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 1', 'beauty-hair-salon' ),
'id' => 'footer-1',
'description' => __( 'Add widgets here to appear in your footer.', 'beauty-hair-salon' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 2', 'beauty-hair-salon' ),
'id' => 'footer-2',
'description' => __( 'Add widgets here to appear in your footer.', 'beauty-hair-salon' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 3', 'beauty-hair-salon' ),
'id' => 'footer-3',
'description' => __( 'Add widgets here to appear in your footer.', 'beauty-hair-salon' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 4', 'beauty-hair-salon' ),
'id' => 'footer-4',
'description' => __( 'Add widgets here to appear in your footer.', 'beauty-hair-salon' ),
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'beauty_hair_salon_widgets_init' );
// dropdown
function beauty_hair_salon_shop_dropdown(){
if(get_option('beauty_hair_salon_shop_show_hide') == true ) {
return true;
}
return false;
}
// remove sections
function beauty_hair_salon_customize_register() {
global $wp_customize;
$wp_customize->remove_section( 'beauty_salon_spa_pro' );
$wp_customize->remove_setting('beauty_salon_spa_slider_content_alignment');
$wp_customize->remove_control('beauty_salon_spa_slider_content_alignment');
$wp_customize->remove_setting('beauty_salon_spa_footer_text');
$wp_customize->remove_control('beauty_salon_spa_footer_text');
}
add_action( 'customize_register', 'beauty_hair_salon_customize_register', 11 );
// customizer
function beauty_hair_salon_customize( $wp_customize ) {
wp_enqueue_style('customizercustom_css', esc_url( get_stylesheet_directory_uri() ). '/assets/css/customizer.css');
require get_theme_file_path( 'inc/custom-control.php' );
// pro section
$wp_customize->add_section('beauty_hair_salon_pro', array(
'title' => __('UPGRADE HAIR SALON PREMIUM', 'beauty-hair-salon'),
'priority' => 1,
));
$wp_customize->add_setting('beauty_hair_salon_pro', array(
'default' => null,
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control(new Beauty_Hair_Salon_Pro_Control($wp_customize, 'beauty_hair_salon_pro', array(
'label' => __('HAIR SALON PREMIUM', 'beauty-hair-salon'),
'section' => 'beauty_hair_salon_pro',
'settings' => 'beauty_hair_salon_pro',
'priority' => 1,
)));
// slider content alignment
$wp_customize->add_setting( 'beauty_hair_salon_slider_content_alignment',
array(
'default' => 'RIGHT-ALIGN',
'transport' => 'refresh',
'sanitize_callback' => 'beauty_salon_spa_sanitize_choices'
)
);
$wp_customize->add_control( new Beauty_Hair_Salon_Text_Radio_Button_Custom_Control( $wp_customize, 'beauty_hair_salon_slider_content_alignment',
array(
'type' => 'select',
'label' => esc_html__( 'Slider Content Alignment', 'beauty-hair-salon' ),
'section' => 'beauty_salon_spa_slider_section',
'choices' => array(
'LEFT-ALIGN' => __('LEFT','beauty-hair-salon'),
'CENTER-ALIGN' => __('CENTER','beauty-hair-salon'),
'RIGHT-ALIGN' => __('RIGHT','beauty-hair-salon'),
),
'active_callback' => 'beauty_salon_spa_slider_dropdown',
)
) );
// Product
$wp_customize->add_section('beauty_hair_salon_shop_section',array(
'title' => __('Product Settings','beauty-hair-salon'),
'priority' => 5,
'panel' => 'beauty_salon_spa_custompage_panel',
));
$wp_customize->add_setting( 'beauty_hair_salon_shop_heading', array(
'default' => '',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( new Beauty_Hair_Salon_Customizer_Customcontrol_Section_Heading( $wp_customize, 'beauty_hair_salon_shop_heading', array(
'label' => esc_html__( 'Product Settings', 'beauty-hair-salon' ),
'section' => 'beauty_hair_salon_shop_section',
'settings' => 'beauty_hair_salon_shop_heading',
) ) );
$wp_customize->add_setting(
'beauty_hair_salon_shop_show_hide',
array(
'type' => 'option',
'capability' => 'edit_theme_options',
'theme_supports' => '',
'default' => '',
'transport' => 'refresh',
'sanitize_callback' => 'beauty_salon_spa_callback_sanitize_switch',
)
);
$wp_customize->add_control(
new Beauty_Hair_Salon_Customizer_Customcontrol_Switch(
$wp_customize,
'beauty_hair_salon_shop_show_hide',
array(
'settings' => 'beauty_hair_salon_shop_show_hide',
'section' => 'beauty_hair_salon_shop_section',
'label' => __( 'Check To show Section', 'beauty-hair-salon' ),
'choices' => array(
'1' => __( 'On', 'beauty-hair-salon' ),
'off' => __( 'Off', 'beauty-hair-salon' ),
),
'active_callback' => '',
)
)
);
$wp_customize->add_setting('beauty_hair_salon_shop_text',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('beauty_hair_salon_shop_text',array(
'type' => 'text',
'label' => __('Sub Heading Text','beauty-hair-salon'),
'section' => 'beauty_hair_salon_shop_section',
'active_callback' => 'beauty_hair_salon_shop_dropdown',
));
$wp_customize->add_setting('beauty_hair_salon_shop_title',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('beauty_hair_salon_shop_title',array(
'type' => 'text',
'label' => __('Heading Text','beauty-hair-salon'),
'section' => 'beauty_hair_salon_shop_section',
'active_callback' => 'beauty_hair_salon_shop_dropdown',
));
// Product settings
$beauty_hair_salon_args = array(
'type' => 'product',
'child_of' => 0,
'parent' => '',
'orderby' => 'term_group',
'order' => 'ASC',
'hide_empty' => false,
'hierarchical' => 1,
'number' => '',
'taxonomy' => 'product_cat',
'pad_counts' => false
);
$categories = get_categories($beauty_hair_salon_args);
$cat_posts = array();
$m = 0;
$cat_posts[]='Select';
foreach($categories as $category){
if($m==0){
$default = $category->slug;
$m++;
}
$cat_posts[$category->slug] = $category->name;
}
$wp_customize->add_setting('beauty_hair_salon_shop_category',array(
'default' => 'select',
'sanitize_callback' => 'beauty_salon_spa_sanitize_select',
));
$wp_customize->add_control('beauty_hair_salon_shop_category',array(
'type' => 'select',
'choices' => $cat_posts,
'label' => __('Select category to display products ','beauty-hair-salon'),
'section' => 'beauty_hair_salon_shop_section',
'active_callback' => 'beauty_hair_salon_shop_dropdown',
));
$wp_customize->add_setting('beauty_hair_salon_footer_text',array(
'default' => 'Beauty WordPress Theme',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('beauty_hair_salon_footer_text',array(
'label' => esc_html__('Copyright Text','beauty-hair-salon'),
'section' => 'beauty_salon_spa_footer_copyright',
'type' => 'textarea'
));
}
add_action( 'customize_register', 'beauty_hair_salon_customize' );
// comments
function beauty_hair_salon_enqueue_comments_reply() {
if( is_singular() && comments_open() && ( get_option( 'thread_comments' ) == 1) ) {
// Load comment-reply.js (into footer)
wp_enqueue_script( 'comment-reply', '/wp-includes/js/comment-reply.min.js', array(), false, true );
}
}
add_action( 'wp_enqueue_scripts', 'beauty_hair_salon_enqueue_comments_reply' );
// Footer Text
function beauty_hair_salon_copyright_link() {
$footer_text = get_theme_mod('beauty_hair_salon_footer_text', esc_html__('Beauty WordPress Theme', 'beauty-hair-salon'));
$credit_link = esc_url('https://www.ovationthemes.com/wordpress/free-beauty-wordpress-theme/');
echo '' . esc_html($footer_text) . '';
}
if ( ! defined( 'BEAUTY_HAIR_SALON_PRO_LINK' ) ) {
define('BEAUTY_HAIR_SALON_PRO_LINK',__('https://www.ovationthemes.com/wordpress/hair-salon-wordpress-theme/','beauty-hair-salon'));
}
/* Pro control */
if (class_exists('WP_Customize_Control') && !class_exists('Beauty_Hair_Salon_Pro_Control')):
class Beauty_Hair_Salon_Pro_Control extends WP_Customize_Control{
public function render_content(){?>