add_panel('being_customizer', [ 'priority' => 10, 'title' => esc_html__('Being Customizer', 'being'), ]); /** * Customizer Section */ $wp_customize->add_section('theme_color_setting', [ 'title' => esc_html__('Color Settings', 'being'), 'description' => '', 'priority' => 10, 'capability' => 'edit_theme_options', 'panel' => 'being_customizer', ]); $wp_customize->add_section('header_social', [ 'title' => esc_html__('Social', 'being'), 'description' => '', 'priority' => 11, 'capability' => 'edit_theme_options', 'panel' => 'being_customizer', ]); $wp_customize->add_section('section_header_logo', [ 'title' => esc_html__('Header Setting', 'being'), 'description' => '', 'priority' => 12, 'capability' => 'edit_theme_options', 'panel' => 'being_customizer', ]); $wp_customize->add_section('section_sidebar', [ 'title' => esc_html__('Sidebar Setting', 'being'), 'description' => '', 'priority' => 12, 'capability' => 'edit_theme_options', 'panel' => 'being_customizer', ]); $wp_customize->add_section('section_menu', [ 'title' => esc_html__('Menu Setting', 'being'), 'description' => '', 'priority' => 13, 'capability' => 'edit_theme_options', 'panel' => 'being_customizer', ]); $wp_customize->add_section('section_preloader', [ 'title' => esc_html__('Preloader Setting', 'being'), 'description' => '', 'priority' => 14, 'capability' => 'edit_theme_options', 'panel' => 'being_customizer', ]); $wp_customize->add_section('section_body_bg', [ 'title' => esc_html__('Body Background Setting', 'being'), 'description' => '', 'priority' => 15, 'capability' => 'edit_theme_options', 'panel' => 'being_customizer', ]); $wp_customize->add_section('blog_setting', [ 'title' => esc_html__('Blog Setting', 'being'), 'description' => '', 'priority' => 16, 'capability' => 'edit_theme_options', 'panel' => 'being_customizer', ]); $wp_customize->add_section('blog_setting', [ 'title' => esc_html__('Blog Setting', 'being'), 'description' => '', 'priority' => 17, 'capability' => 'edit_theme_options', 'panel' => 'being_customizer', ]); $wp_customize->add_section('footer_setting', [ 'title' => esc_html__('Footer Settings', 'being'), 'description' => '', 'priority' => 18, 'capability' => 'edit_theme_options', 'panel' => 'being_customizer', ]); $wp_customize->add_section('color_setting', [ 'title' => esc_html__('Color Setting', 'being'), 'description' => '', 'priority' => 19, 'capability' => 'edit_theme_options', 'panel' => 'being_customizer', ]); $wp_customize->add_section('404_page', [ 'title' => esc_html__('404 Page', 'being'), 'description' => '', 'priority' => 20, 'capability' => 'edit_theme_options', 'panel' => 'being_customizer', ]); $wp_customize->add_section('typo_setting', [ 'title' => esc_html__('Typography Setting', 'being'), 'description' => '', 'priority' => 21, 'capability' => 'edit_theme_options', 'panel' => 'being_customizer', ]); $wp_customize->add_section('slug_setting', [ 'title' => esc_html__('Slug Settings', 'being'), 'description' => '', 'priority' => 22, 'capability' => 'edit_theme_options', 'panel' => 'being_customizer', ]); } add_action('customize_register', 'being_customizer_panels_sections'); /* Header Social */ function _header_social_fields($fields) { $fields[] = [ 'type' => 'switch', 'settings' => 'social_switch', 'label' => esc_html__('Social On/Off', 'being'), 'section' => 'header_social', 'default' => 'on', 'priority' => 10, 'choices' => [ 'on' => esc_html__('Enable', 'being'), 'off' => esc_html__('Disable', 'being'), ], ]; // header section social $fields[] = [ 'type' => 'text', 'settings' => 'fb_url', 'label' => esc_html__('Facebook Url', 'being'), 'section' => 'header_social', 'default' => '', 'priority' => 10, ]; $fields[] = [ 'type' => 'text', 'settings' => 'twitter_url', 'label' => esc_html__('Twitter Url', 'being'), 'section' => 'header_social', 'default' => '', 'priority' => 10, ]; $fields[] = [ 'type' => 'text', 'settings' => 'linkedin_url', 'label' => esc_html__('Linkedin Url', 'being'), 'section' => 'header_social', 'default' => '', 'priority' => 10, ]; $fields[] = [ 'type' => 'text', 'settings' => 'instagram_url', 'label' => esc_html__('Instagram Url', 'being'), 'section' => 'header_social', 'default' => '', 'priority' => 10, ]; $fields[] = [ 'type' => 'text', 'settings' => 'youtube_url', 'label' => esc_html__('Youtube Url', 'being'), 'section' => 'header_social', 'default' => '', 'priority' => 10, ]; $fields[] = [ 'type' => 'text', 'settings' => 'behance_url', 'label' => esc_html__('Behance Url', 'being'), 'section' => 'header_social', 'default' => '', 'priority' => 10, ]; $fields[] = [ 'type' => 'text', 'settings' => 'pinterest_url', 'label' => esc_html__('Pinterest Url', 'being'), 'section' => 'header_social', 'default' => '', 'priority' => 10, ]; $fields[] = [ 'type' => 'text', 'settings' => 'tumblr_url', 'label' => esc_html__('Tumblr Url', 'being'), 'section' => 'header_social', 'default' => '', 'priority' => 10, ]; $fields[] = [ 'type' => 'text', 'settings' => 'tiktok_url', 'label' => esc_html__('Tiktok Url', 'being'), 'section' => 'header_social', 'default' => '', 'priority' => 10, ]; return $fields; } add_filter('kirki/fields', '_header_social_fields'); /* Header Settings */ function header_header_fields($fields) { $fields[] = [ 'type' => 'image', 'settings' => 'logo', 'label' => esc_html__('Header Logo', 'being'), 'description' => esc_html__('Upload Your Logo.', 'being'), 'section' => 'section_header_logo', 'default' => get_template_directory_uri() . '/assets/images/being-logo-white.png', ]; $fields[] = [ 'type' => 'image', 'settings' => 'logo_light', 'label' => esc_html__('Header Logo Dark', 'being'), 'description' => esc_html__('Upload Your Dark Logo.', 'being'), 'section' => 'section_header_logo', 'default' => get_template_directory_uri() . '/assets/images/logo/being-logo.png', ]; $fields[] = [ 'type' => 'text', 'settings' => 'header_email', 'label' => esc_html__('Email', 'being'), 'section' => 'section_header_logo', 'default' => esc_html__('myname@email.com', 'being'), 'priority' => 10, ]; $fields[] = [ 'type' => 'text', 'settings' => 'header_phone', 'label' => esc_html__('Phone', 'being'), 'section' => 'section_header_logo', 'default' => esc_html__('00 000000000', 'being'), 'priority' => 10, ]; // preloader text $fields[] = [ 'type' => 'text', 'settings' => 'being_logo_width', 'label' => esc_html__('Logo Width', 'being'), 'section' => 'section_header_logo', 'default' => esc_html__('85', 'being'), 'priority' => 10, ]; return $fields; } add_filter('kirki/fields', 'header_header_fields'); /* Sidebar Settings */ function header_sidebar_fields($fields) { $fields[] = [ 'type' => 'switch', 'settings' => 'side_bar_option', 'label' => esc_html__('Show Side Bars', 'being'), 'section' => 'section_sidebar', 'default' => 'on', 'choices' => [ 'on' => esc_html__('On', 'being'), 'off' => esc_html__('Off', 'being'), ], ]; $fields[] = [ 'type' => 'text', 'settings' => 'side_bar_1', 'label' => esc_html__('Side Bar Text 1', 'being'), 'section' => 'section_sidebar', 'default' => esc_html__('Side Bar 1', 'being'), ]; $fields[] = [ 'type' => 'text', 'settings' => 'side_bar_2', 'label' => esc_html__('Side Bar Text 2', 'being'), 'section' => 'section_sidebar', 'default' => esc_html__('Side Bar 2', 'being'), ]; $fields[] = [ 'type' => 'text', 'settings' => 'side_bar_3', 'label' => esc_html__('Side Bar Text 3', 'being'), 'section' => 'section_sidebar', 'default' => esc_html__('Side Bar 3', 'being'), ]; $fields[] = [ 'type' => 'text', 'settings' => 'side_bar_4', 'label' => esc_html__('Side Bar Text 4', 'being'), 'section' => 'section_sidebar', 'default' => esc_html__('Side Bar 4', 'being'), ]; return $fields; } add_filter('kirki/fields', 'header_sidebar_fields'); /* Preloader */ function _header_preloader_fields($fields) { // preloader switch $fields[] = [ 'type' => 'switch', 'settings' => 'preloader_switch', 'label' => esc_html__('Preloader On/Off', 'being'), 'section' => 'section_preloader', 'default' => 'on', 'priority' => 10, 'choices' => [ 'on' => esc_html__('Enable', 'being'), 'off' => esc_html__('Disable', 'being'), ], ]; return $fields; } add_filter('kirki/fields', '_header_preloader_fields'); /* Header Social */ function _header_blog_fields($fields) { // Blog Setting $fields[] = [ 'type' => 'switch', 'settings' => 'being_blog_btn_switch', 'label' => esc_html__('Blog Read More On/Off', 'being'), 'section' => 'blog_setting', 'default' => '1', 'priority' => 10, 'choices' => [ 'on' => esc_html__('Enable', 'being'), 'off' => esc_html__('Disable', 'being'), ], ]; $fields[] = [ 'type' => 'switch', 'settings' => 'being_blog_single_social', 'label' => esc_html__('Blog Share On/Off', 'being'), 'section' => 'blog_setting', 'default' => '0', 'priority' => 10, 'choices' => [ 'on' => esc_html__('Enable', 'being'), 'off' => esc_html__('Disable', 'being'), ], ]; $fields[] = [ 'type' => 'switch', 'settings' => 'being_blog_cat', 'label' => esc_html__('Blog Category Meta On/Off', 'being'), 'section' => 'blog_setting', 'default' => '1', 'priority' => 10, 'choices' => [ 'on' => esc_html__('Enable', 'being'), 'off' => esc_html__('Disable', 'being'), ], ]; $fields[] = [ 'type' => 'switch', 'settings' => 'being_blog_view', 'label' => esc_html__('Blog View Meta On/Off', 'being'), 'section' => 'blog_setting', 'default' => '1', 'priority' => 10, 'choices' => [ 'on' => esc_html__('Enable', 'being'), 'off' => esc_html__('Disable', 'being'), ], ]; $fields[] = [ 'type' => 'switch', 'settings' => 'being_blog_author', 'label' => esc_html__('Blog Author Meta On/Off', 'being'), 'section' => 'blog_setting', 'default' => '1', 'priority' => 10, 'choices' => [ 'on' => esc_html__('Enable', 'being'), 'off' => esc_html__('Disable', 'being'), ], ]; $fields[] = [ 'type' => 'switch', 'settings' => 'being_blog_date', 'label' => esc_html__('Blog Date Meta On/Off', 'being'), 'section' => 'blog_setting', 'default' => '1', 'priority' => 10, 'choices' => [ 'on' => esc_html__('Enable', 'being'), 'off' => esc_html__('Disable', 'being'), ], ]; $fields[] = [ 'type' => 'switch', 'settings' => 'being_blog_comments', 'label' => esc_html__('Blog Comments Meta On/Off', 'being'), 'section' => 'blog_setting', 'default' => '1', 'priority' => 10, 'choices' => [ 'on' => esc_html__('Enable', 'being'), 'off' => esc_html__('Disable', 'being'), ], ]; $fields[] = [ 'type' => 'text', 'settings' => 'being_blog_btn', 'label' => esc_html__('Blog Button text', 'being'), 'section' => 'blog_setting', 'default' => esc_html__('Read More', 'being'), 'priority' => 10, ]; $fields[] = [ 'type' => 'text', 'settings' => 'breadcrumb_blog_title', 'label' => esc_html__('Blog Title', 'being'), 'section' => 'blog_setting', 'default' => esc_html__('Blog', 'being'), 'priority' => 10, ]; $fields[] = [ 'type' => 'text', 'settings' => 'breadcrumb_blog_title_details', 'label' => esc_html__('Blog Details Title', 'being'), 'section' => 'blog_setting', 'default' => esc_html__('Blog Details', 'being'), 'priority' => 10, ]; return $fields; } add_filter('kirki/fields', '_header_blog_fields'); function _theme_color_setting_fields($fields) { $fields[] = [ 'type' => 'switch', 'settings' => 'color_mode', 'label' => esc_html__('Show Color Mode Switch', 'being'), 'section' => 'theme_color_setting', 'default' => 'on', 'choices' => [ 'on' => esc_html__('On', 'being'), 'off' => esc_html__('Off', 'being'), ], ]; $fields[] = [ 'type' => 'switch', 'settings' => 'color_mode_light', 'label' => esc_html__('Color Mode Light/Dark', 'being'), 'section' => 'theme_color_setting', 'default' => 'off', 'choices' => [ 'off' => esc_html__('Light', 'being'), 'on' => esc_html__('Dark', 'being'), ], ]; $fields[] = [ 'type' => 'radio-image', 'settings' => 'choose_default_theme', 'label' => esc_html__('Choose Theme Style', 'being'), 'section' => 'theme_color_setting', 'default' => '5', 'placeholder' => esc_html__('Select an option...', 'being'), 'priority' => 10, 'multiple' => 1, 'choices' => [ 'theme-style-1' => get_template_directory_uri() . '/inc/img/theme/light.jpg' ], 'default' => 'theme-style-1', ]; $fields[] = [ 'type' => 'color', 'settings' => 'theme_primary_color', 'label' => __('Theme Color', 'being'), 'description' => esc_html__('This is a Theme color control.', 'being'), 'section' => 'theme_color_setting', 'default' => primary_color, 'priority' => 10, 'active_callback' => [ [ 'setting' => 'choose_default_theme', 'operator' => '===', 'value' => 'theme-style-1', ], ] ]; // Color Settings $fields[] = [ 'type' => 'color', 'settings' => 'theme_secondary_color', 'label' => __('Secondary Color', 'being'), 'description' => esc_html__('This is a Secondary color control.', 'being'), 'section' => 'theme_color_setting', 'default' => secondary_color, 'priority' => 10, 'active_callback' => [ [ 'setting' => 'choose_default_theme', 'operator' => '===', 'value' => 'theme-style-1', ], ] ]; //theme 2 $fields[] = [ 'type' => 'color', 'settings' => 'theme_primary_color_2', 'label' => __('Theme Color', 'being'), 'description' => esc_html__('This is a Theme color control.', 'being'), 'section' => 'theme_color_setting', 'default' => '#D8293A', 'priority' => 10, 'active_callback' => [ [ 'setting' => 'choose_default_theme', 'operator' => '===', 'value' => 'theme-style-2', ], ] ]; $fields[] = [ 'type' => 'color', 'settings' => 'theme_primary_color_dark_2', 'label' => __('Theme Color', 'being'), 'description' => esc_html__('This is a Theme color control.', 'being'), 'section' => 'theme_color_setting', 'default' => '#D8293A', 'priority' => 10, 'active_callback' => [ [ 'setting' => 'choose_default_theme', 'operator' => '===', 'value' => 'theme-style-2', ], ] ]; $fields[] = [ 'type' => 'color', 'settings' => 'theme_secondary_color_2', 'label' => __('Secondary Color', 'being'), 'description' => esc_html__('This is a Secondary color control.', 'being'), 'section' => 'theme_color_setting', 'default' => '#f5ddd3', 'priority' => 10, 'active_callback' => [ [ 'setting' => 'choose_default_theme', 'operator' => '===', 'value' => 'theme-style-2', ], ] ]; //theme 3 $fields[] = [ 'type' => 'color', 'settings' => 'theme_primary_color_3', 'label' => __('Theme Color', 'being'), 'description' => esc_html__('This is a Theme color control.', 'being'), 'section' => 'theme_color_setting', 'default' => '#000', 'priority' => 10, 'active_callback' => [ [ 'setting' => 'choose_default_theme', 'operator' => '===', 'value' => 'theme-style-3', ], ] ]; $fields[] = [ 'type' => 'color', 'settings' => 'theme_primary_color_dark_3', 'label' => __('Theme Color Dark', 'being'), 'description' => esc_html__('This is a Theme color control.', 'being'), 'section' => 'theme_color_setting', 'default' => '#CCC', 'priority' => 10, 'active_callback' => [ [ 'setting' => 'choose_default_theme', 'operator' => '===', 'value' => 'theme-style-3', ], ] ]; $fields[] = [ 'type' => 'color', 'settings' => 'theme_secondary_color_3', 'label' => __('Secondary Color', 'being'), 'description' => esc_html__('This is a Secondary color control.', 'being'), 'section' => 'theme_color_setting', 'default' => '#FFFFFF', 'priority' => 10, 'active_callback' => [ [ 'setting' => 'choose_default_theme', 'operator' => '===', 'value' => 'theme-style-3', ], ] ]; return $fields; } add_filter('kirki/fields', '_theme_color_setting_fields'); // 404 function being_404_fields($fields) { // 404 settings $fields[] = [ 'type' => 'image', 'settings' => 'being_404_bg', 'label' => esc_html__('404 Image.', 'being'), 'description' => esc_html__('404 Image.', 'being'), 'section' => '404_page', ]; $fields[] = [ 'type' => 'text', 'settings' => 'being_error_title', 'label' => esc_html__('Not Found Title', 'being'), 'section' => '404_page', 'default' => esc_html__('Oops! Error 404', 'being'), 'priority' => 10, ]; $fields[] = [ 'type' => 'textarea', 'settings' => 'being_error_desc', 'label' => esc_html__('404 Description Text', 'being'), 'section' => '404_page', 'default' => esc_html__('It looks like nothing was found at this location.', 'being'), 'priority' => 10, ]; $fields[] = [ 'type' => 'text', 'settings' => 'being_error_link_text', 'label' => esc_html__('404 Link Text', 'being'), 'section' => '404_page', 'default' => esc_html__('Back To Home', 'being'), 'priority' => 10, ]; return $fields; } add_filter('kirki/fields', 'being_404_fields'); /** * Added Fields */ function being_typo_fields($fields) { // typography settings $fields[] = [ 'type' => 'typography', 'settings' => 'typography_body_setting', 'label' => esc_html__('Body Font', 'being'), 'section' => 'typo_setting', 'default' => [ 'font-family' => '', 'variant' => '', ], 'priority' => 10, 'transport' => 'auto', 'output' => [ [ 'element' => 'body', ], ], ]; $fields[] = [ 'type' => 'typography', 'settings' => 'typography_h_setting', 'label' => esc_html__('Heading h1 Fonts', 'being'), 'section' => 'typo_setting', 'default' => [ 'font-family' => '', 'variant' => '', ], 'priority' => 10, 'transport' => 'auto', 'output' => [ [ 'element' => 'body h1', ], ], ]; $fields[] = [ 'type' => 'typography', 'settings' => 'typography_h2_setting', 'label' => esc_html__('Heading h2 Fonts', 'being'), 'section' => 'typo_setting', 'default' => [ 'font-family' => '', 'variant' => '', ], 'priority' => 10, 'transport' => 'auto', 'output' => [ [ 'element' => 'body h2', ], ], ]; $fields[] = [ 'type' => 'typography', 'settings' => 'typography_h3_setting', 'label' => esc_html__('Heading h3 Fonts', 'being'), 'section' => 'typo_setting', 'default' => [ 'font-family' => '', 'variant' => '', ], 'priority' => 10, 'transport' => 'auto', 'output' => [ [ 'element' => 'body h3', ], ], ]; $fields[] = [ 'type' => 'typography', 'settings' => 'typography_h4_setting', 'label' => esc_html__('Heading h4 Fonts', 'being'), 'section' => 'typo_setting', 'default' => [ 'font-family' => '', 'variant' => '', ], 'priority' => 10, 'transport' => 'auto', 'output' => [ [ 'element' => 'body h4', ], ], ]; $fields[] = [ 'type' => 'typography', 'settings' => 'typography_h5_setting', 'label' => esc_html__('Heading h5 Fonts', 'being'), 'section' => 'typo_setting', 'default' => [ 'font-family' => '', 'variant' => '', ], 'priority' => 10, 'transport' => 'auto', 'output' => [ [ 'element' => 'body h5', ], ], ]; $fields[] = [ 'type' => 'typography', 'settings' => 'typography_h6_setting', 'label' => esc_html__('Heading h6 Fonts', 'being'), 'section' => 'typo_setting', 'default' => [ 'font-family' => '', 'variant' => '', ], 'priority' => 10, 'transport' => 'auto', 'output' => [ [ 'element' => 'body h6', ], ], ]; return $fields; } add_filter('kirki/fields', 'being_typo_fields'); /** * ============================================================================ * Remove Unused Native Sections * ============================================================================ */ function being_remove_customizer_sections($wp_customize) { $wp_customize->remove_section('custom_logo'); $wp_customize->remove_section('colors'); } add_action('customize_register', 'being_remove_customizer_sections'); function blogpress_theme_settings_section($wp_customize) { $wp_customize->remove_control('custom_logo'); } add_action('customize_register', 'blogpress_theme_settings_section'); /** * This is a short hand function for getting setting value from customizer * * @param string $name * * @return bool|string */ function being_THEME_option($name) { $value = ''; if (class_exists('being')) { $value = Kirki::get_option(being_get_theme(), $name); } return apply_filters('being_THEME_option', $value, $name); } /** * Get config ID * * @return string */ function being_get_theme() { return 'being'; }