default ); } function biztrix_sanitize_checkbox( $checked ) { // Boolean check. return ( ( isset( $checked ) && true == $checked ) ? true : false ); } $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; //Panel for section & control $wp_customize->add_panel( 'biztrix_panel_section', array( 'priority' => null, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __( 'Theme Options Panel', 'biztrix' ), ) ); $wp_customize->add_setting('biztrix_site_color_options',array( 'default' => '#273272', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize,'biztrix_site_color_options',array( 'label' => __('Color Options','biztrix'), 'section' => 'colors', 'settings' => 'biztrix_site_color_options' )) ); $wp_customize->add_setting('biztrix_site_hovercolor_options',array( 'default' => '#8497a8', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize,'biztrix_site_hovercolor_options',array( 'label' => __('Hover Color Options','biztrix'), 'section' => 'colors', 'settings' => 'biztrix_site_hovercolor_options' )) ); //Site Sticky Header $wp_customize->add_section('biztrix_sticky_header_sec',array( 'title' => __('Sticky Header','biztrix'), 'priority' => null, 'panel' => 'biztrix_panel_section', )); $wp_customize->add_setting('biztrix_stickyheader',array( 'default' => null, 'sanitize_callback' => 'biztrix_sanitize_checkbox', )); $wp_customize->add_control( 'biztrix_stickyheader', array( 'section' => 'biztrix_sticky_header_sec', 'label' => __('Check to Hide sticky header on scroll','biztrix'), 'type' => 'checkbox' )); //end sticky header Section //Header Social icons $wp_customize->add_section('biztrix_social_area',array( 'title' => __('Header social icons','biztrix'), 'description' => __( 'Add social icons link here to display icons in header.', 'biztrix' ), 'priority' => null, 'panel' => 'biztrix_panel_section', )); $wp_customize->add_setting('biztrix_fb_link',array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('biztrix_fb_link',array( 'label' => __('Add facebook link here','biztrix'), 'section' => 'biztrix_social_area', 'setting' => 'biztrix_fb_link' )); $wp_customize->add_setting('biztrix_gplus_link',array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('biztrix_gplus_link',array( 'label' => __('Add google plus link here','biztrix'), 'section' => 'biztrix_social_area', 'setting' => 'biztrix_gplus_link' )); $wp_customize->add_setting('biztrix_twitt_link',array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('biztrix_twitt_link',array( 'label' => __('Add twitter link here','biztrix'), 'section' => 'biztrix_social_area', 'setting' => 'biztrix_twitt_link' )); $wp_customize->add_setting('biztrix_linkedin_link',array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('biztrix_linkedin_link',array( 'label' => __('Add linkedin link here','biztrix'), 'section' => 'biztrix_social_area', 'setting' => 'biztrix_linkedin_link' )); $wp_customize->add_setting('biztrix_youtube_link',array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('biztrix_youtube_link',array( 'label' => __('Add Youtube link here','biztrix'), 'section' => 'biztrix_social_area', 'setting' => 'biztrix_youtube_link' )); // Header Slider Section $wp_customize->add_section( 'biztrix_homeslider_sections', array( 'title' => __('Biztrix Slider Section', 'biztrix'), 'priority' => null, 'description' => __('Default image size for slider is 1400 x 730 pixel.','biztrix'), 'panel' => 'biztrix_panel_section', )); $wp_customize->add_setting('biztrix_frontslider_pagearea1',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biztrix_sanitize_dropdown_pages' )); $wp_customize->add_control('biztrix_frontslider_pagearea1',array( 'type' => 'dropdown-pages', 'label' => __('Select page for slider first:','biztrix'), 'section' => 'biztrix_homeslider_sections' )); $wp_customize->add_setting('biztrix_frontslider_pagearea2',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biztrix_sanitize_dropdown_pages' )); $wp_customize->add_control('biztrix_frontslider_pagearea2',array( 'type' => 'dropdown-pages', 'label' => __('Select page for slider second:','biztrix'), 'section' => 'biztrix_homeslider_sections' )); $wp_customize->add_setting('biztrix_frontslider_pagearea3',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biztrix_sanitize_dropdown_pages' )); $wp_customize->add_control('biztrix_frontslider_pagearea3',array( 'type' => 'dropdown-pages', 'label' => __('Select page for slider third:','biztrix'), 'section' => 'biztrix_homeslider_sections' )); // Slider Section Options $wp_customize->add_setting('biztrix_frontslider_morebtntext',array( 'default' => null, 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('biztrix_frontslider_morebtntext',array( 'type' => 'text', 'label' => __('Add slider Read more button name here','biztrix'), 'section' => 'biztrix_homeslider_sections', 'setting' => 'biztrix_frontslider_morebtntext' )); // Slider Read More Button Text $wp_customize->add_setting('biztrix_show_home_slider_section',array( 'default' => false, 'sanitize_callback' => 'biztrix_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'biztrix_show_home_slider_section', array( 'settings' => 'biztrix_show_home_slider_section', 'section' => 'biztrix_homeslider_sections', 'label' => __('Check To Show This Section','biztrix'), 'type' => 'checkbox' ));//Show Home Slider Section //Callout $wp_customize->add_section('biztrix_get_an_Callout_section',array( 'title' => __('Biztrix Callout Section','biztrix'), 'description' => __( 'Add Callout', 'biztrix' ), 'priority' => null, 'panel' => 'biztrix_panel_section', )); $wp_customize->add_setting('biztrix_get_callout_text',array( 'default' => null, 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('biztrix_get_callout_text',array( 'type' => 'text', 'label' => __('Add Callout text here','biztrix'), 'section' => 'biztrix_get_an_Callout_section', 'setting' => 'biztrix_get_callout_text' )); $wp_customize->add_setting('biztrix_get_callout_btntext',array( 'default' => null, 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('biztrix_get_callout_btntext',array( 'type' => 'text', 'label' => __('Add Callout button text here','biztrix'), 'section' => 'biztrix_get_an_Callout_section', 'setting' => 'biztrix_get_callout_btntext' )); $wp_customize->add_setting('biztrix_get_callout_btnlink',array( 'default' => null, 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('biztrix_get_callout_btnlink',array( 'label' => __('Add link for Get an Callout button','biztrix'), 'section' => 'biztrix_get_an_Callout_section', 'setting' => 'biztrix_get_callout_btnlink' )); $wp_customize->add_setting( 'biztrix_slider_image', array( 'default' => '', 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'slider_image', array( 'label' => __('Upload Image','biztrix'), 'section' => 'biztrix_get_an_Callout_section', 'description' => esc_html__('Select image For Slide #', 'biztrix'), 'settings' => 'biztrix_slider_image', ))); $wp_customize->add_setting('biztrix_show_get_callout_button',array( 'default' => false, 'sanitize_callback' => 'biztrix_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'biztrix_show_get_callout_button', array( 'settings' => 'biztrix_show_get_callout_button', 'section' => 'biztrix_get_an_Callout_section', 'label' => __('Check To show Callout button','biztrix'), 'type' => 'checkbox' ));//Show Callout // Services Section $wp_customize->add_section('biztrix_4column_services_sections', array( 'title' => __('Biztrix Services Sections','biztrix'), 'description' => __('Select pages from the dropdown for services section','biztrix'), 'priority' => null, 'panel' => 'biztrix_panel_section', )); $wp_customize->add_setting('biztrix_fourpage_colorbox1',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biztrix_sanitize_dropdown_pages' )); $wp_customize->add_control( 'biztrix_fourpage_colorbox1',array( 'type' => 'dropdown-pages', 'section' => 'biztrix_4column_services_sections', )); $wp_customize->add_setting('biztrix_fourpage_colorbox2',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biztrix_sanitize_dropdown_pages' )); $wp_customize->add_control( 'biztrix_fourpage_colorbox2',array( 'type' => 'dropdown-pages', 'section' => 'biztrix_4column_services_sections', )); $wp_customize->add_setting('biztrix_fourpage_colorbox3',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biztrix_sanitize_dropdown_pages' )); $wp_customize->add_control( 'biztrix_fourpage_colorbox3',array( 'type' => 'dropdown-pages', 'section' => 'biztrix_4column_services_sections', )); $wp_customize->add_setting('biztrix_fourpage_colorbox4',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biztrix_sanitize_dropdown_pages' )); $wp_customize->add_control( 'biztrix_fourpage_colorbox5',array( 'type' => 'dropdown-pages', 'section' => 'biztrix_4column_services_sections', )); $wp_customize->add_setting('biztrix_fourpage_colorbox5',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biztrix_sanitize_dropdown_pages' )); $wp_customize->add_control( 'biztrix_fourpage_colorbox5',array( 'type' => 'dropdown-pages', 'section' => 'biztrix_4column_services_sections', )); $wp_customize->add_setting('biztrix_fourpage_colorbox6',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biztrix_sanitize_dropdown_pages' )); $wp_customize->add_control( 'biztrix_fourpage_colorbox6',array( 'type' => 'dropdown-pages', 'section' => 'biztrix_4column_services_sections', )); $wp_customize->add_setting('biztrix_show_fourcolumn_colorbox_sections',array( 'default' => false, 'sanitize_callback' => 'biztrix_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'biztrix_show_fourcolumn_colorbox_sections', array( 'settings' => 'biztrix_show_fourcolumn_colorbox_sections', 'section' => 'biztrix_4column_services_sections', 'label' => __('Check To Show This Section','biztrix'), 'type' => 'checkbox' ));//Show four column Services Sections // Welcome Page Section $wp_customize->add_section('biztrix_blog_sections', array( 'title' => __('Biztrix Blog Section','biztrix'), 'description' => __('Select Pages from the dropdown for welcome section','biztrix'), 'priority' => null, 'panel' => 'biztrix_panel_section', )); $wp_customize->add_setting('biztrix_blog_category_id',array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biztrix_sanitize_category', 'default' => '1', ) ); $wp_customize->add_control(new biztrix_Customize_Dropdown_Taxonomies_Control($wp_customize,'biztrix_blog_category_id', array( 'label' => esc_html__('Select Category for Blog','biztrix'), 'section' => 'biztrix_blog_sections', 'settings' => 'biztrix_blog_category_id', 'type'=> 'dropdown-taxonomies', ) ));//Show Welcome Section //scroll to top Options $wp_customize->add_section('biztrix_scroll_options', array( 'title' => __('Scroll To Top Options','biztrix'), 'priority' => null, 'panel' => 'biztrix_panel_section', )); $wp_customize->add_setting('biztrix_hide_scroll',array( 'default' => false, 'sanitize_callback' => 'biztrix_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'biztrix_hide_scroll', array( 'settings' => 'biztrix_hide_scroll', 'section' => 'biztrix_scroll_options', 'label' => __('Check to hide Scroll To Top','biztrix'), 'type' => 'checkbox' )); //scroll to top Options //Preloader Options $wp_customize->add_section('biztrix_preloader_options', array( 'title' => __('Preloader Options','biztrix'), 'priority' => null, 'panel' => 'biztrix_panel_section', )); $wp_customize->add_setting('biztrix_hide_preloader',array( 'default' => false, 'sanitize_callback' => 'biztrix_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'biztrix_hide_preloader', array( 'settings' => 'biztrix_hide_preloader', 'section' => 'biztrix_preloader_options', 'label' => __('Check to hide Preloader','biztrix'), 'type' => 'checkbox' )); //Preloader Options //Sidebar Settings $wp_customize->add_section('biztrix_sidebar_options', array( 'title' => __('Sidebar Options','biztrix'), 'priority' => null, 'panel' => 'biztrix_panel_section', )); $wp_customize->add_setting('biztrix_hidesidebar_from_blogpage',array( 'default' => false, 'sanitize_callback' => 'biztrix_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'biztrix_hidesidebar_from_blogpage', array( 'settings' => 'biztrix_hidesidebar_from_blogpage', 'section' => 'biztrix_sidebar_options', 'label' => __('Check to hide sidebar from All post page','biztrix'), 'type' => 'checkbox' ));// Hide sidebar from latest post page $wp_customize->add_setting('biztrix_hidesidebar_singlepost',array( 'default' => false, 'sanitize_callback' => 'biztrix_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'biztrix_hidesidebar_singlepost', array( 'settings' => 'biztrix_hidesidebar_singlepost', 'section' => 'biztrix_sidebar_options', 'label' => __('Check to hide sidebar from single post','biztrix'), 'type' => 'checkbox' ));// hide sidebar single post $wp_customize->add_setting('biztrix_hidesidebar_pages',array( 'default' => false, 'sanitize_callback' => 'biztrix_sanitize_checkbox', 'capability' => 'edit_theme_options', )); $wp_customize->add_control( 'biztrix_hidesidebar_pages', array( 'settings' => 'biztrix_hidesidebar_pages', 'section' => 'biztrix_sidebar_options', 'label' => __('Check to hide sidebar from all pages','biztrix'), 'type' => 'checkbox' ));//hide sidebar from all pages } add_action( 'customize_register', 'biztrix_customize_register' ); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function biztrix_customize_preview_js() { wp_enqueue_script( 'biztrix_customizer', get_template_directory_uri() . '/js/customize-preview.js', array( 'customize-preview' ), '19062019', true ); } add_action( 'customize_preview_init', 'biztrix_customize_preview_js' ); if( class_exists( 'WP_Customize_Control' ) ) { /** * Class biztrix_Customize_Dropdown_Taxonomies_Control */ class biztrix_Customize_Dropdown_Taxonomies_Control extends WP_Customize_Control { public $type = 'dropdown-taxonomies'; public $taxonomy = ''; public function __construct( $manager, $id, $args = array() ) { $our_taxonomy = 'category'; if ( isset( $args['taxonomy'] ) ) { $taxonomy_exist = taxonomy_exists( esc_attr( $args['taxonomy'] ) ); if ( true === $taxonomy_exist ) { $our_taxonomy = esc_attr( $args['taxonomy'] ); } } $args['taxonomy'] = $our_taxonomy; $this->taxonomy = esc_attr( $our_taxonomy ); parent::__construct( $manager, $id, $args ); } public function render_content() { $tax_args = array( 'hierarchical' => 1, 'taxonomy' => $this->taxonomy, ); $all_taxonomies = get_categories( $tax_args ); ?>