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', '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() { $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 . ''; } } } /** 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' ); ?>