is_rtl(), 'animation' => get_theme_mod( 'slider_animation' ), 'auto' => get_theme_mod( 'slider_auto', true ), ); wp_localize_script( 'blossom-beauty', 'blossom_beauty_data', $array ); } add_action( 'wp_enqueue_scripts', 'blossom_beauty_styles', 10 ); //Remove a function from the parent theme function blossom_beauty_remove_parent_filters(){ remove_action( 'customize_register', 'blossom_feminine_customizer_theme_info' ); remove_action( 'customize_register', 'blossom_feminine_customize_register_color' ); remove_action( 'customize_register', 'blossom_feminine_customize_register_appearance' ); } add_action( 'init', 'blossom_beauty_remove_parent_filters' ); function blossom_beauty_customizer_register( $wp_customize ) { $wp_customize->add_section( 'theme_info', array( 'title' => __( 'Demo & Documentation' , 'blossom-beauty' ), 'priority' => 6, ) ); /** Important Links */ $wp_customize->add_setting( 'theme_info_theme', array( 'default' => '', 'sanitize_callback' => 'wp_kses_post', ) ); $theme_info = '

'; $theme_info .= sprintf( __( 'Demo Link: %1$sClick here.%2$s', 'blossom-beauty' ), '', '' ); $theme_info .= '

'; $theme_info .= sprintf( __( 'Documentation Link: %1$sClick here.%2$s', 'blossom-beauty' ), '', '' ); $theme_info .= '

'; $wp_customize->add_control( new Blossom_Feminine_Note_Control( $wp_customize, 'theme_info_theme', array( 'section' => 'theme_info', 'description' => $theme_info ) ) ); /** Appearance Settings */ $wp_customize->add_panel( 'appearance_settings', array( 'priority' => 50, 'capability' => 'edit_theme_options', 'title' => __( 'Appearance Settings', 'blossom-beauty' ), 'description' => __( 'Customize Typography, Header Image & Background Image', 'blossom-beauty' ), ) ); /** Typography */ $wp_customize->add_section( 'typography_settings', array( 'title' => __( 'Typography', 'blossom-beauty' ), 'priority' => 10, 'panel' => 'appearance_settings', ) ); /** Primary Font */ $wp_customize->add_setting( 'primary_font', array( 'default' => 'Muli', 'sanitize_callback' => 'blossom_feminine_sanitize_select' ) ); $wp_customize->add_control( new Blossom_Feminine_Select_Control( $wp_customize, 'primary_font', array( 'label' => __( 'Primary Font', 'blossom-beauty' ), 'description' => __( 'Primary font of the site.', 'blossom-beauty' ), 'section' => 'typography_settings', 'choices' => blossom_feminine_get_all_fonts(), ) ) ); /** Secondary Font */ $wp_customize->add_setting( 'secondary_font', array( 'default' => 'EB Garamond', 'sanitize_callback' => 'blossom_feminine_sanitize_select' ) ); $wp_customize->add_control( new Blossom_Feminine_Select_Control( $wp_customize, 'secondary_font', array( 'label' => __( 'Secondary Font', 'blossom-beauty' ), 'description' => __( 'Secondary font of the site.', 'blossom-beauty' ), 'section' => 'typography_settings', 'choices' => blossom_feminine_get_all_fonts(), ) ) ); /** Font Size*/ $wp_customize->add_setting( 'font_size', array( 'default' => 18, 'sanitize_callback' => 'blossom_feminine_sanitize_number_absint' ) ); $wp_customize->add_control( new Blossom_Feminine_Slider_Control( $wp_customize, 'font_size', array( 'section' => 'typography_settings', 'label' => __( 'Font Size', 'blossom-beauty' ), 'description' => __( 'Change the font size of your site.', 'blossom-beauty' ), 'choices' => array( 'min' => 10, 'max' => 50, 'step' => 1, ) ) ) ); /** Move Header Image section to appearance panel */ $wp_customize->get_section( 'header_image' )->panel = 'appearance_settings'; $wp_customize->get_section( 'header_image' )->priority = 20; $wp_customize->remove_control( 'header_textcolor' ); /** Move Background Image section to appearance panel */ $wp_customize->get_section( 'background_image' )->panel = 'appearance_settings'; $wp_customize->get_section( 'background_image' )->priority = 30; /** Primary Color*/ $wp_customize->add_setting( 'primary_color', array( 'default' => '#d8bbb5', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'primary_color', array( 'label' => __( 'Primary Color', 'blossom-beauty' ), 'description' => __( 'Primary color of the theme.', 'blossom-beauty' ), 'section' => 'colors', 'priority' => 5, ) ) ); /** Layout Settings */ $wp_customize->add_panel( 'layout_settings', array( 'title' => __( 'Layout Settings', 'blossom-beauty' ), 'priority' => 55, ) ); /** Header Layout Section */ $wp_customize->add_section( 'header_layout', array( 'title' => __( 'Header Layout', 'blossom-beauty' ), 'panel' => 'layout_settings', 'priority' => 10, ) ); /** Header layout */ $wp_customize->add_setting( 'header_layout_option', array( 'default' => 'two', 'sanitize_callback' => 'blossom_feminine_sanitize_radio' ) ); $wp_customize->add_control( new Blossom_Feminine_Radio_Image_Control( $wp_customize, 'header_layout_option', array( 'section' => 'header_layout', 'label' => __( 'Header Layout', 'blossom-beauty' ), 'description' => __( 'This is the layout for header.', 'blossom-beauty' ), 'choices' => array( 'one' => get_stylesheet_directory_uri() . '/images/header/header-one.jpg', 'two' => get_stylesheet_directory_uri() . '/images/header/header-two.jpg', ) ) ) ); /** Slider Layout Settings */ $wp_customize->add_section( 'slider_layout_settings', array( 'title' => __( 'Slider Layout', 'blossom-beauty' ), 'priority' => 20, 'panel' => 'layout_settings', ) ); /** Slider layout */ $wp_customize->add_setting( 'slider_layout', array( 'default' => 'two', 'sanitize_callback' => 'blossom_feminine_sanitize_radio' ) ); $wp_customize->add_control( new Blossom_Feminine_Radio_Image_Control( $wp_customize, 'slider_layout', array( 'section' => 'slider_layout_settings', 'label' => __( 'Slider Layout', 'blossom-beauty' ), 'description' => __( 'Choose the layout of the slider for your site.', 'blossom-beauty' ), 'choices' => array( 'one' => get_stylesheet_directory_uri() . '/images/slider/one.jpg', 'two' => get_stylesheet_directory_uri() . '/images/slider/two.jpg', ) ) ) ); /** Instagram Title */ $wp_customize->add_setting( 'instagram_title', array( 'default' => __( 'FOLLOW ALONG', 'blossom-beauty' ), 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'instagram_title', array( 'label' => __( 'Instagram Section Title', 'blossom-beauty' ), 'section' => 'instagram_settings', ) ); } add_action( 'customize_register', 'blossom_beauty_customizer_register', 40 ); /** Categories */ function blossom_feminine_categories() { // Hide category and tag text for pages. if ( 'post' === get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( ' ' ); if ( $categories_list ) { echo '' . $categories_list . ''; } } } /** Header */ function blossom_feminine_header(){ $bg = get_header_image() ? ' style="background-image:url(' . esc_url( get_header_image() ) . ')"' : ''; $header_layout = get_theme_mod( 'header_layout_option', 'two' ); ?>
'secondary', 'menu_id' => 'secondary-menu', 'fallback_cb' => 'blossom_feminine_secondary_menu_fallback', ) ); ?>
" >

'primary', 'menu_id' => 'primary-menu', 'fallback_cb' => 'blossom_feminine_primary_menu_fallback', ) ); ?>
'post', 'post_status' => 'publish', 'ignore_sticky_posts' => true ); if( $slider_type === 'cat' && $slider_cat ){ $args['cat'] = $slider_cat; $args['posts_per_page'] = -1; }else{ $args['posts_per_page'] = $posts_per_page; } $qry = new WP_Query( $args ); if( $qry->have_posts() ){ ?>
have_posts() ){ $qry->the_post(); ?>
', '' ); ?>
'; comments_popup_link( sprintf( wp_kses( /* translators: %s: post title */ __( 'Leave a Comment on %s', 'blossom-beauty' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ) ); echo ''; } } function blossom_feminine_content_start(){ $class = is_404() ? 'error-holder' : 'row' ; ?>
'; echo '' . esc_html( $instagram_title ) . ''; echo do_shortcode( '[blossomthemes_instagram_feed]' ); echo ''; } } } /** Newsletter section */ function blossom_beauty_newsletter(){ if( blossom_feminine_is_btnw_activated() && ! is_single() ){ $ed_newsletter = get_theme_mod( 'ed_newsletter', false ); $newsletter = get_theme_mod( 'newsletter_shortcode' ); ?>
'; echo do_shortcode( $newsletter ); echo '
'; } ?> 'Playfair Display', 'variant'=>'700italic' ) ); $ig_site_title_font = blossom_feminine_is_google_font( $site_title_font['font-family'] ); /* Translators: If there are characters in your language that are not * supported by respective fonts, translate this to 'off'. Do not translate * into your own language. */ $primary = _x( 'on', 'Primary Font: on or off', 'blossom-beauty' ); $secondary = _x( 'on', 'Secondary Font: on or off', 'blossom-beauty' ); $site_title = _x( 'on', 'Site Title Font: on or off', 'blossom-beauty' ); if ( 'off' !== $primary || 'off' !== $secondary || 'off' !== $site_title ) { $font_families = array(); if ( 'off' !== $primary && $ig_primary_font ) { $primary_variant = blossom_feminine_check_varient( $primary_font, 'regular', true ); if( $primary_variant ){ $primary_var = ':' . $primary_variant; }else{ $primary_var = ''; } $font_families[] = $primary_font . $primary_var; } if ( 'off' !== $secondary && $ig_secondary_font ) { $secondary_variant = blossom_feminine_check_varient( $secondary_font, 'regular', true ); if( $secondary_variant ){ $secondary_var = ':' . $secondary_variant; }else{ $secondary_var = ''; } $font_families[] = $secondary_font . $secondary_var; } if ( 'off' !== $site_title && $ig_site_title_font ) { if( ! empty( $site_title_font['variant'] ) ){ $site_title_var = ':' . blossom_feminine_check_varient( $site_title_font['font-family'], $site_title_font['variant'] ); }else{ $site_title_var = ''; } $font_families[] = $site_title_font['font-family'] . $site_title_var; } $font_families = array_diff( array_unique( $font_families ), array('') ); $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } return esc_url_raw( $fonts_url ); } /** Dyanmic CSS */ function blossom_feminine_dynamic_css(){ $primary_font = get_theme_mod( 'primary_font', 'Muli' ); $primary_fonts = blossom_feminine_get_fonts( $primary_font, 'regular' ); $secondary_font = get_theme_mod( 'secondary_font', 'EB Garamond' ); $secondary_fonts = blossom_feminine_get_fonts( $secondary_font, 'regular' ); $font_size = get_theme_mod( 'font_size', 18 ); $site_title_font = get_theme_mod( 'site_title_font', array( 'font-family'=>'Playfair Display', 'variant'=>'700italic' ) ); $site_title_fonts = blossom_feminine_get_fonts( $site_title_font['font-family'], $site_title_font['variant'] ); $site_title_font_size = get_theme_mod( 'site_title_font_size', 60 ); $primary_color = get_theme_mod( 'primary_color', '#d8bbb5' ); $rgb = blossom_feminine_hex2rgb( blossom_feminine_sanitize_hex_color( $primary_color ) ); echo ""; } /** Footer */ function blossom_feminine_footer_bottom(){ ?>
' . esc_html__( 'Blossom Themes', 'blossom-beauty' ) . '.'; printf( esc_html__( ' Powered by %s', 'blossom-beauty' ), 'WordPress.' ); if ( function_exists( 'the_privacy_policy_link' ) ) { the_privacy_policy_link(); } ?>