selective_refresh ) ? 'postMessage' : 'refresh';
$wp_customize->add_panel(
'artech_general', array(
'priority' => 31,
'title' => esc_html__( 'General', 'artech' ),
)
);
/*=========================================
Preloader
=========================================*/
$wp_customize->add_section(
'preloader', array(
'title' => esc_html__( 'Preloader', 'artech' ),
'priority' => 1,
'panel' => 'artech_general',
)
);
//Preloader Documentation Link
class WP_preloader_Customize_Control extends WP_Customize_Control {
public $type = 'new_menu';
function render_content()
{
?>
How to add preloader section :
Customizer > preloader Section
Click Here
add_setting(
'preloader_doc_link' ,
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(new WP_preloader_Customize_Control($wp_customize,
'preloader_doc_link' ,
array(
'label' => __( 'preloader Documentation Link', 'artech' ),
'section' => 'preloader',
'type' => 'radio',
'description' => __( 'General Documentation Link', 'artech' ),
)
) );
$wp_customize->add_setting(
'hs_preloader' ,
array(
'default' => '',
'sanitize_callback' => 'artech_sanitize_checkbox',
'capability' => 'edit_theme_options',
'priority' => 1,
)
);
$wp_customize->add_control(
'hs_preloader',
array(
'label' => esc_html__( 'Hide / Show Preloader', 'artech' ),
'section' => 'preloader',
'type' => 'checkbox'
)
);
/*=========================================
Scroller
=========================================*/
$wp_customize->add_section(
'top_scroller', array(
'title' => esc_html__( 'Top Scroller', 'artech' ),
'priority' => 4,
'panel' => 'artech_general',
)
);
//Top Scroller Documentation Link
class WP_top_scroller_Customize_Control extends WP_Customize_Control {
public $type = 'new_menu';
function render_content()
{
?>
How to use top scroller section :
General > Top Scroller
Click Here
add_setting(
'top_scroller_doc_link' ,
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(new WP_top_scroller_Customize_Control($wp_customize,
'top_scroller_doc_link' ,
array(
'label' => __( 'Top Scroller Documentation Link', 'artech' ),
'section' => 'top_scroller',
'type' => 'radio',
'description' => __( 'Top Scroller Documentation Link', 'artech' ),
)
) );
$wp_customize->add_setting(
'hs_scroller' ,
array(
'default' => '1',
'sanitize_callback' => 'artech_sanitize_checkbox',
'capability' => 'edit_theme_options',
'priority' => 1,
)
);
$wp_customize->add_control(
'hs_scroller',
array(
'label' => esc_html__( 'Hide / Show Scroller', 'artech' ),
'section' => 'top_scroller',
'type' => 'checkbox'
)
);
/*=========================================
Breadcrumb Section
=========================================*/
$wp_customize->add_section(
'breadcrumb_setting', array(
'title' => esc_html__( 'Page Breadcrumb', 'artech' ),
'priority' => 12,
'panel' => 'artech_general',
)
);
// Settings
$wp_customize->add_setting(
'breadcrumb_settings'
,array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'artech_sanitize_text',
'priority' => 1,
)
);
$wp_customize->add_control(
'breadcrumb_settings',
array(
'type' => 'hidden',
'label' => __('Settings','artech'),
'section' => 'breadcrumb_setting',
)
);
// Breadcrumb Hide/ Show Setting //
$wp_customize->add_setting(
'hs_breadcrumb' ,
array(
'default' => '1',
'sanitize_callback' => 'artech_sanitize_checkbox',
'capability' => 'edit_theme_options',
'priority' => 2,
)
);
$wp_customize->add_control(
'hs_breadcrumb',
array(
'label' => esc_html__( 'Hide / Show Section', 'artech' ),
'section' => 'breadcrumb_setting',
'settings' => 'hs_breadcrumb',
'type' => 'checkbox'
)
);
// enable on Page Title
$wp_customize->add_setting(
'breadcrumb_title_enable'
,array(
'default' => '1',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'artech_sanitize_checkbox',
'priority' => 3,
)
);
$wp_customize->add_control(
'breadcrumb_title_enable',
array(
'type' => 'checkbox',
'label' => __('Enable Page Title on Breadcrumb?','artech'),
'section' => 'breadcrumb_setting',
)
);
// enable on Page Path
$wp_customize->add_setting(
'breadcrumb_path_enable'
,array(
'default' => '1',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'artech_sanitize_checkbox',
'priority' => 4,
)
);
$wp_customize->add_control(
'breadcrumb_path_enable',
array(
'type' => 'checkbox',
'label' => __('Enable Page Path on Breadcrumb?','artech'),
'section' => 'breadcrumb_setting',
)
);
// Breadcrumb Content Section //
$wp_customize->add_setting(
'breadcrumb_contents'
,array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'artech_sanitize_text',
'priority' => 5,
)
);
$wp_customize->add_control(
'breadcrumb_contents',
array(
'type' => 'hidden',
'label' => __('Content','artech'),
'section' => 'breadcrumb_setting',
)
);
// Seprator //
$wp_customize->add_setting(
'breadcrumb_seprator',
array(
'default' => __( '-', 'artech'),
'sanitize_callback' => 'artech_sanitize_text',
'capability' => 'edit_theme_options',
'priority' => 7,
)
);
$wp_customize->add_control(
'breadcrumb_seprator',
array(
'label' => esc_html__('Seprator','artech'),
'section' => 'breadcrumb_setting',
'type' => 'text',
)
);
// Content size //
$wp_customize->add_setting(
'breadcrumb_min_height',
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'artech_sanitize_range_value',
'transport' => 'postMessage',
'priority' => 8,
)
);
$wp_customize->add_control(
new Artech_Customizer_Range_Control( $wp_customize, 'breadcrumb_min_height',
array(
'label' => __( 'Min Height', 'artech'),
'section' => 'breadcrumb_setting',
'media_query' => true,
'input_attr' => array(
'mobile' => array(
'min' => 0,
'max' => 1000,
'step' => 1,
'default_value' => 246,
),
'tablet' => array(
'min' => 0,
'max' => 1000,
'step' => 1,
'default_value' => 246,
),
'desktop' => array(
'min' => 0,
'max' => 1000,
'step' => 1,
'default_value' => 246,
),
),
) )
);
if ( class_exists( 'Artech_Customizer_Range_Control' ) ) {
// Title size //
$wp_customize->add_setting(
'breadcrumb_title_size',
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'artech_sanitize_range_value',
'transport' => 'postMessage',
'priority' => 14,
)
);
$wp_customize->add_control(
new Artech_Customizer_Range_Control( $wp_customize, 'breadcrumb_title_size',
array(
'label' => __( 'Title Size', 'artech' ),
'section' => 'breadcrumb_setting',
'media_query' => true,
'input_attr' => array(
'mobile' => array(
'min' => 0,
'max' => 100,
'step' => 1,
'default_value' => 34,
),
'tablet' => array(
'min' => 0,
'max' => 100,
'step' => 1,
'default_value' => 34,
),
'desktop' => array(
'min' => 0,
'max' => 100,
'step' => 1,
'default_value' => 34,
),
),
) )
);
// Content size //
$wp_customize->add_setting(
'breadcrumb_content_size',
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'artech_sanitize_range_value',
'transport' => 'postMessage',
'priority' => 15,
)
);
$wp_customize->add_control(
new Artech_Customizer_Range_Control( $wp_customize, 'breadcrumb_content_size',
array(
'label' => __( 'Content Size', 'artech' ),
'section' => 'breadcrumb_setting',
'media_query' => true,
'input_attr' => array(
'mobile' => array(
'min' => 0,
'max' => 50,
'step' => 1,
'default_value' => 16,
),
'tablet' => array(
'min' => 0,
'max' => 50,
'step' => 1,
'default_value' => 16,
),
'desktop' => array(
'min' => 0,
'max' => 50,
'step' => 1,
'default_value' => 16,
),
),
) )
);
}
}
add_action( 'customize_register', 'artech_genearl_setting' );