is_rtl(), 'animation' => get_theme_mod( 'slider_animation' ), 'auto' => (bool)get_theme_mod( 'slider_auto', true ), ); wp_localize_script( 'blossom-chic', 'blossom_chic_data', $array ); } endif; add_action( 'wp_enqueue_scripts', 'blossom_chic_styles', 10 ); //Remove a function from the parent theme function remove_parent_filters(){ //Have to do it after theme setup, because child theme functions are loaded first 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', 'remove_parent_filters' ); function blossom_feminine_body_classes( $classes ) { global $wp_query; $blog_layout_option = get_theme_mod( 'blog_layout_option', 'home-two' ); // Adds a class of hfeed to non-singular pages. if ( ! is_singular() ) { $classes[] = 'hfeed'; } if ( $wp_query->found_posts == 0 ) { $classes[] = 'no-post'; } // Adds a class of custom-background-image to sites with a custom background image. if ( get_background_image() ) { $classes[] = 'custom-background-image custom-background'; } if ( is_page() || is_single() ) { $classes[] = 'underline'; } // Adds a class of custom-background-color to sites with a custom background color. if ( get_background_color() != 'ffffff' ) { $classes[] = 'custom-background-color custom-background'; } if( is_search() && ! is_post_type_archive( 'product' ) ){ $classes[] = 'search-result-page'; } $classes[] = blossom_feminine_sidebar_layout(); if( $blog_layout_option == 'home-two' ){ $classes[] = 'blog-layout-two'; } return $classes; } function blossom_chic_customizer_register( $wp_customize ) { $wp_customize->add_section( 'theme_info', array( 'title' => __( 'Demo & Documentation' , 'blossom-chic' ), '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-chic' ), '', '' ); $theme_info .= '
'; $theme_info .= sprintf( __( 'Documentation Link: %1$sClick here.%2$s', 'blossom-chic' ), '', '' ); $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-chic' ), 'description' => __( 'Customize Typography, Header Image & Background Image', 'blossom-chic' ), ) ); /** Typography */ $wp_customize->add_section( 'typography_settings', array( 'title' => __( 'Typography', 'blossom-chic' ), 'priority' => 10, 'panel' => 'appearance_settings', ) ); /** Primary Font */ $wp_customize->add_setting( 'primary_font', array( 'default' => 'Nunito Sans', 'sanitize_callback' => 'blossom_feminine_sanitize_select' ) ); $wp_customize->add_control( new Blossom_Feminine_Select_Control( $wp_customize, 'primary_font', array( 'label' => __( 'Primary Font', 'blossom-chic' ), 'description' => __( 'Primary font of the site.', 'blossom-chic' ), 'section' => 'typography_settings', 'choices' => blossom_feminine_get_all_fonts(), ) ) ); /** Secondary Font */ $wp_customize->add_setting( 'secondary_font', array( 'default' => 'Cormorant', 'sanitize_callback' => 'blossom_feminine_sanitize_select' ) ); $wp_customize->add_control( new Blossom_Feminine_Select_Control( $wp_customize, 'secondary_font', array( 'label' => __( 'Secondary Font', 'blossom-chic' ), 'description' => __( 'Secondary font of the site.', 'blossom-chic' ), 'section' => 'typography_settings', 'choices' => blossom_feminine_get_all_fonts(), ) ) ); /** Font Size*/ $wp_customize->add_setting( 'font_size', array( 'default' => 16, '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-chic' ), 'description' => __( 'Change the font size of your site.', 'blossom-chic' ), 'choices' => array( 'min' => 10, 'max' => 50, 'step' => 1, ) ) ) ); $wp_customize->add_setting( 'ed_localgoogle_fonts', array( 'default' => false, 'sanitize_callback' => 'blossom_feminine_sanitize_checkbox', ) ); $wp_customize->add_control( new Blossom_Feminine_Toggle_Control( $wp_customize, 'ed_localgoogle_fonts', array( 'section' => 'typography_settings', 'label' => __( 'Load Google Fonts Locally', 'blossom-chic' ), 'description' => __( 'Enable to load google fonts from your own server instead from google\'s CDN. This solves privacy concerns with Google\'s CDN and their sometimes less-than-transparent policies.', 'blossom-chic' ) ) ) ); $wp_customize->add_setting( 'ed_preload_local_fonts', array( 'default' => false, 'sanitize_callback' => 'blossom_feminine_sanitize_checkbox', ) ); $wp_customize->add_control( new Blossom_Feminine_Toggle_Control( $wp_customize, 'ed_preload_local_fonts', array( 'section' => 'typography_settings', 'label' => __( 'Preload Local Fonts', 'blossom-chic' ), 'description' => __( 'Preloading Google fonts will speed up your website speed.', 'blossom-chic' ), 'active_callback' => 'blossom_feminine_ed_localgoogle_fonts' ) ) ); ob_start(); ?> add_setting( 'ed_flush_local_fonts', array( 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( 'ed_flush_local_fonts', array( 'label' => __( 'Flush Local Fonts Cache', 'blossom-chic' ), 'section' => 'typography_settings', 'description' => $blossom_chic_flush_button, 'type' => 'hidden', 'active_callback' => 'blossom_feminine_ed_localgoogle_fonts' ) ); /** 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' => '#f69581', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'primary_color', array( 'label' => __( 'Primary Color', 'blossom-chic' ), 'description' => __( 'Primary color of the theme.', 'blossom-chic' ), 'section' => 'colors', 'priority' => 5, ) ) ); /** Secondary Color*/ $wp_customize->add_setting( 'secondary_color', array( 'default' => '#feeae3', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'secondary_color', array( 'label' => __( 'Secondary Color', 'blossom-chic' ), 'description' => __( 'Secondary color of the theme.', 'blossom-chic' ), 'section' => 'colors', 'priority' => 5, ) ) ); /** Layout Settings */ $wp_customize->add_panel( 'layout_settings', array( 'title' => __( 'Layout Settings', 'blossom-chic' ), 'priority' => 55, ) ); /** Blog Layout */ $wp_customize->add_section( 'header_layout', array( 'title' => __( 'Header Layout', 'blossom-chic' ), 'panel' => 'layout_settings', 'priority' => 10, ) ); /** Blog Page layout */ $wp_customize->add_setting( 'header_layout_option', array( 'default' => 'two', 'sanitize_callback' => 'esc_attr' ) ); $wp_customize->add_control( new Blossom_Feminine_Radio_Image_Control( $wp_customize, 'header_layout_option', array( 'section' => 'header_layout', 'label' => __( 'Header Layout', 'blossom-chic' ), 'description' => __( 'This is the layout for header.', 'blossom-chic' ), 'choices' => array( 'one' => get_stylesheet_directory_uri() . '/images/header/header-one.png', 'two' => get_stylesheet_directory_uri() . '/images/header/header-two.png', ) ) ) ); /** Blog Layout */ $wp_customize->add_section( 'blog_layout', array( 'title' => __( 'Home Page Layout', 'blossom-chic' ), 'panel' => 'layout_settings', 'priority' => 10, ) ); /** Blog Page layout */ $wp_customize->add_setting( 'blog_layout_option', array( 'default' => 'home-two', 'sanitize_callback' => 'esc_attr' ) ); $wp_customize->add_control( new Blossom_Feminine_Radio_Image_Control( $wp_customize, 'blog_layout_option', array( 'section' => 'blog_layout', 'label' => __( 'Home Page Layout', 'blossom-chic' ), 'description' => __( 'This is the layout for blog index page.', 'blossom-chic' ), 'choices' => array( 'home-one' => get_stylesheet_directory_uri() . '/images/home/one-right.jpg', 'home-two' => get_stylesheet_directory_uri() . '/images/home/two-right.jpg', ) ) ) ); /** Slider Layout Settings */ $wp_customize->add_section( 'slider_layout_settings', array( 'title' => __( 'Slider Layout', 'blossom-chic' ), 'priority' => 20, 'panel' => 'layout_settings', ) ); /** Page Sidebar layout */ $wp_customize->add_setting( 'slider_layout', array( 'default' => 'two', 'sanitize_callback' => 'esc_attr' ) ); $wp_customize->add_control( new Blossom_Feminine_Radio_Image_Control( $wp_customize, 'slider_layout', array( 'section' => 'slider_layout_settings', 'label' => __( 'Slider Layout', 'blossom-chic' ), 'description' => __( 'Choose the layout of the slider for your site.', 'blossom-chic' ), 'choices' => array( 'one' => get_stylesheet_directory_uri() . '/images/slider/one.jpg', 'two' => get_stylesheet_directory_uri() . '/images/slider/two.jpg', ) ) ) ); } add_action( 'customize_register', 'blossom_chic_customizer_register', 40 ); function blossom_feminine_categories() { $ed_cat_single = get_theme_mod( 'ed_category', false ); // Hide category and tag text for pages. if ( 'post' === get_post_type() && !$ed_cat_single ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( ' ' ); if ( $categories_list ) { echo '' . $categories_list . ''; } } } 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' ); ?>