__('primary Menu', 'arcstheme')
));
};
add_action('after_setup_theme', 'arcstheme_theme_setup');
function arcstheme_scripts(){
wp_enqueue_style('style', get_stylesheet_uri());
wp_enqueue_script('jquery');
wp_enqueue_script('arcstheme-browser', get_template_directory_uri(). '/assets/js/browser.min.js');
wp_enqueue_script('arcstheme-breakpoints', get_template_directory_uri(). '/assets/js/breakpoints.min.js');
wp_enqueue_script('arcstheme-util', get_template_directory_uri(). '/assets/js/util.js');
wp_enqueue_script('arcstheme-main', get_template_directory_uri(). '/assets/js/main.js');
wp_enqueue_script('arcstheme-nav', get_template_directory_uri(). '/assets/js/nav.js');
}
add_action('wp_enqueue_scripts', 'arcstheme_scripts');
function arcstheme_widgets_init(){
register_sidebar(array(
'name' => __('Primary Sidebar', 'arcstheme'),
'id' => 'main-sidebar',
'description' => 'main Sidebar on Right Side',
'before_widget' => '',
'before_title' => '',
));
register_sidebar(array(
'name' => __('Home Banner', 'arcstheme'),
'id' => 'home-banner',
'description' => 'Banner Area on Homepage',
'before_widget' => '',
'before_title' => '
',
));
register_sidebar(array(
'name' => __('Home Services', 'arcstheme'),
'id' => 'home-services',
'description' => 'Services Area on Homepage',
'before_widget' => '',
'before_title' => '',
));
register_sidebar(array(
'name' => __('Footer widget 1', 'arcstheme'),
'id' => 'footer-1',
'before_widget' => '',
'before_title' => '',
));
register_sidebar(array(
'name' => __('Footer widget 2', 'arcstheme'),
'id' => 'footer-2',
'before_widget' => '',
'before_title' => '',
));
register_sidebar(array(
'name' => __('Footer widget 3', 'arcstheme'),
'id' => 'footer-3',
'before_widget' => '',
'before_title' => '',
));
}add_action( 'widgets_init', 'arcstheme_widgets_init' );
/****footer background *****/
function customize_footer_background($wp_customize) {
$wp_customize->add_section('footer_background_section', array(
'title' => __('Footer Background', 'arcstheme'),
'priority' => 30,
));
// Background Color
$wp_customize->add_setting('footer_background_color', array(
'default' => '#3498db',
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'footer_background_color', array(
'label' => __('Background Color', 'arcstheme'),
'section' => 'footer_background_section',
)));
// Background Gradient
$wp_customize->add_setting('footer_background_gradient', array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('footer_background_gradient', array(
'label' => __('Background Gradient', 'arcstheme'),
'section' => 'footer_background_section',
));
// Background Image
$wp_customize->add_setting('footer_background_image', array(
'default' => '',
'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'footer_background_image', array(
'label' => __('Background Image', 'arcstheme'),
'section' => 'footer_background_section',
)));
// Background Position
$wp_customize->add_setting('footer_background_position', array(
'default' => 'center center',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('footer_background_position', array(
'label' => __('Background Position', 'arcstheme'),
'section' => 'footer_background_section',
));
// Background Size
$wp_customize->add_setting('footer_background_size', array(
'default' => 'cover',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('footer_background_size', array(
'label' => __('Background Size', 'arcstheme'),
'section' => 'footer_background_section',
));
// Background Attachment
$wp_customize->add_setting('footer_background_attachment', array(
'default' => 'fixed',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('footer_background_attachment', array(
'label' => __('Background Attachment', 'arcstheme'),
'section' => 'footer_background_section',
));
// Background Opacity
$wp_customize->add_setting('footer_background_opacity', array(
'default' => 1,
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('footer_background_opacity', array(
'label' => __('Background Opacity', 'arcstheme'),
'section' => 'footer_background_section',
));
}
add_action('customize_register', 'customize_footer_background');
/* typography */
/***body typography***/
function enqueue_google_fonts() {
$google_fonts = array(
'Open+Sans:300,400,600',
'Roboto:400,700',
// Add more Google Fonts as needed
);
wp_enqueue_style('google-fonts', 'https://fonts.googleapis.com/css?family=' . implode('|', $google_fonts), array(), null);
}
add_action('wp_enqueue_scripts', 'enqueue_google_fonts');
function customize_body_typography($wp_customize) {
$wp_customize->add_section('body_typography_section', array(
'title' => __('Body Typography', 'arcstheme'),
'priority' => 30,
));
$wp_customize->add_setting('body_font_source', array(
'default' => 'google', // 'google' or 'custom'
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('body_font_source', array(
'label' => __('Font Source', 'arcstheme'),
'section' => 'body_typography_section',
'type' => 'radio',
'choices' => array(
'google' => __('Google Fonts', 'arcstheme'),
'custom' => __('Custom Fonts', 'arcstheme'),
),
));
$wp_customize->add_setting('body_google_font', array(
'default' => 'Open Sans, sans-serif',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('body_google_font', array(
'label' => __('Google Font', 'arcstheme'),
'section' => 'body_typography_section',
'type' => 'select',
'choices' => array(
'Open Sans, sans-serif' => 'Open Sans',
'Roboto, sans-serif' => 'Roboto',
'Lato, sans-serif' => 'Lato',
'Montserrat, sans-serif' => 'Montserrat',
'Inter, sans-serif'=>'Inter',
'Roboto Condensed, sans-serif'=>'Roboto Condensed',
'Single Day, cursive'=>'Single Day',
),
'active_callback' => function () use ($wp_customize) {
return $wp_customize->get_setting('body_font_source')->value() === 'google';
},
));
$wp_customize->add_setting('body_custom_font', array(
'default' => 'Arial, sans-serif',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('body_custom_font', array(
'label' => __('Custom Font', 'arcstheme'),
'section' => 'body_typography_section',
'type' => 'text',
'active_callback' => function () use ($wp_customize) {
return $wp_customize->get_setting('body_font_source')->value() === 'custom';
},
));
$wp_customize->add_setting('body_font_size', array(
'default' => '16px',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('body_font_size', array(
'label' => __('Font Size', 'arcstheme'),
'section' => 'body_typography_section',
));
$wp_customize->add_setting('body_font_style', array(
'default' => 'normal',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('body_font_style', array(
'label' => __('Font Style', 'arcstheme'),
'section' => 'body_typography_section',
'type' => 'select',
'choices' => array(
'normal' => __('Normal', 'arcstheme'),
'italic' => __('Italic', 'arcstheme'),
),
));
$wp_customize->add_setting('body_font_weight', array(
'default' => '400',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('body_font_weight', array(
'label' => __('Font Weight', 'arcstheme'),
'section' => 'body_typography_section',
));
$wp_customize->add_setting('body_font_color', array(
'default' => '#000000', // Set your default color
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control('body_font_color', array(
'label' => __('Body Font Color', 'arcstheme'),
'section' => 'body_typography_section',
'type' => 'color',
));
// Add more controls for line height, letter spacing, etc., as needed.
}
add_action('customize_register', 'customize_body_typography');
/***heading typography***/
function customize_heading_typography($wp_customize) {
//a
$wp_customize->add_section('a_typography_section', array(
'title' => __('a Typography', 'arcstheme'),
'priority' => 30,
));
$wp_customize->add_setting('a_font_source', array(
'default' => 'google', // 'google' or 'custom'
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('a_font_source', array(
'label' => __('Font Source', 'arcstheme'),
'section' => 'a_typography_section',
'type' => 'radio',
'choices' => array(
'google' => __('Google Fonts', 'arcstheme'),
'custom' => __('Custom Fonts', 'arcstheme'),
),
));
$wp_customize->add_setting('a_google_font', array(
'default' => 'Open Sans, sans-serif',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('a_google_font', array(
'label' => __('Google Font', 'arcstheme'),
'section' => 'a_typography_section',
'type' => 'select',
'choices' => array(
'Open Sans, sans-serif' => 'Open Sans',
'Roboto, sans-serif' => 'Roboto',
'Lato, sans-serif' => 'Lato',
'Montserrat, sans-serif' => 'Montserrat',
'Inter, sans-serif'=>'Inter',
'Roboto Condensed, sans-serif'=>'Roboto Condensed',
'Single Day, cursive'=>'Single Day',
),
'active_callback' => function () use ($wp_customize) {
return $wp_customize->get_setting('a_font_source')->value() === 'google';
},
));
$wp_customize->add_setting('a_custom_font', array(
'default' => 'Arial, sans-serif',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('a_custom_font', array(
'label' => __('Custom Font', 'arcstheme'),
'section' => 'a_typography_section',
'type' => 'text',
'active_callback' => function () use ($wp_customize) {
return $wp_customize->get_setting('a_font_source')->value() === 'custom';
},
));
$wp_customize->add_setting('a_font_size', array(
'default' => '16px',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('a_font_size', array(
'label' => __('Font Size', 'arcstheme'),
'section' => 'a_typography_section',
));
$wp_customize->add_setting('a_font_style', array(
'default' => 'normal',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('a_font_style', array(
'label' => __('Font Style', 'arcstheme'),
'section' => 'a_typography_section',
'type' => 'select',
'choices' => array(
'normal' => __('Normal', 'arcstheme'),
'italic' => __('Italic', 'arcstheme'),
),
));
$wp_customize->add_setting('a_font_weight', array(
'default' => '400',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('a_font_weight', array(
'label' => __('Font Weight', 'arcstheme'),
'section' => 'a_typography_section',
));
$wp_customize->add_setting('a_font_color', array(
'default' => '#000000', // Set your default color
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control('a_font_color', array(
'label' => __('a Font Color', 'arcstheme'),
'section' => 'a_typography_section',
'type' => 'color',
));
//h1
$wp_customize->add_section('h1_typography_section', array(
'title' => __('h1 Typography', 'arcstheme'),
'priority' => 30,
));
$wp_customize->add_setting('h1_font_source', array(
'default' => 'google', // 'google' or 'custom'
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h1_font_source', array(
'label' => __('Font Source', 'arcstheme'),
'section' => 'h1_typography_section',
'type' => 'radio',
'choices' => array(
'google' => __('Google Fonts', 'arcstheme'),
'custom' => __('Custom Fonts', 'arcstheme'),
),
));
$wp_customize->add_setting('h1_google_font', array(
'default' => 'Open Sans, sans-serif',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h1_google_font', array(
'label' => __('Google Font', 'arcstheme'),
'section' => 'h1_typography_section',
'type' => 'select',
'choices' => array(
'Open Sans, sans-serif' => 'Open Sans',
'Roboto, sans-serif' => 'Roboto',
'Lato, sans-serif' => 'Lato',
'Montserrat, sans-serif' => 'Montserrat',
'Inter, sans-serif'=>'Inter',
'Roboto Condensed, sans-serif'=>'Roboto Condensed',
'Single Day, cursive'=>'Single Day',
),
'active_callback' => function () use ($wp_customize) {
return $wp_customize->get_setting('h1_font_source')->value() === 'google';
},
));
$wp_customize->add_setting('h1_custom_font', array(
'default' => 'Arial, sans-serif',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h1_custom_font', array(
'label' => __('Custom Font', 'arcstheme'),
'section' => 'h1_typography_section',
'type' => 'text',
'active_callback' => function () use ($wp_customize) {
return $wp_customize->get_setting('h1_font_source')->value() === 'custom';
},
));
$wp_customize->add_setting('h1_font_size', array(
'default' => '16px',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h1_font_size', array(
'label' => __('Font Size', 'arcstheme'),
'section' => 'h1_typography_section',
));
$wp_customize->add_setting('h1_font_style', array(
'default' => 'normal',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h1_font_style', array(
'label' => __('Font Style', 'arcstheme'),
'section' => 'h1_typography_section',
'type' => 'select',
'choices' => array(
'normal' => __('Normal', 'arcstheme'),
'italic' => __('Italic', 'arcstheme'),
),
));
$wp_customize->add_setting('h1_font_weight', array(
'default' => '400',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h1_font_weight', array(
'label' => __('Font Weight', 'arcstheme'),
'section' => 'h1_typography_section',
));
$wp_customize->add_setting('h1_font_color', array(
'default' => '#000000', // Set your default color
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control('h1_font_color', array(
'label' => __('h1 Font Color', 'arcstheme'),
'section' => 'h1_typography_section',
'type' => 'color',
));
//h2
$wp_customize->add_section('h2_typography_section', array(
'title' => __('h2 Typography', 'arcstheme'),
'priority' => 30,
));
$wp_customize->add_setting('h2_font_source', array(
'default' => 'google', // 'google' or 'custom'
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h2_font_source', array(
'label' => __('Font Source', 'arcstheme'),
'section' => 'h2_typography_section',
'type' => 'radio',
'choices' => array(
'google' => __('Google Fonts', 'arcstheme'),
'custom' => __('Custom Fonts', 'arcstheme'),
),
));
$wp_customize->add_setting('h2_google_font', array(
'default' => 'Open Sans, sans-serif',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h2_google_font', array(
'label' => __('Google Font', 'arcstheme'),
'section' => 'h2_typography_section',
'type' => 'select',
'choices' => array(
'Open Sans, sans-serif' => 'Open Sans',
'Roboto, sans-serif' => 'Roboto',
'Lato, sans-serif' => 'Lato',
'Montserrat, sans-serif' => 'Montserrat',
'Inter, sans-serif'=>'Inter',
'Roboto Condensed, sans-serif'=>'Roboto Condensed',
'Single Day, cursive'=>'Single Day',
),
'active_callback' => function () use ($wp_customize) {
return $wp_customize->get_setting('h2_font_source')->value() === 'google';
},
));
$wp_customize->add_setting('h2_custom_font', array(
'default' => 'Arial, sans-serif',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h2_custom_font', array(
'label' => __('Custom Font', 'arcstheme'),
'section' => 'h2_typography_section',
'type' => 'text',
'active_callback' => function () use ($wp_customize) {
return $wp_customize->get_setting('h2_font_source')->value() === 'custom';
},
));
$wp_customize->add_setting('h2_font_size', array(
'default' => '24px',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h2_font_size', array(
'label' => __('Font Size', 'arcstheme'),
'section' => 'h2_typography_section',
));
$wp_customize->add_setting('h2_font_style', array(
'default' => 'normal',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h2_font_style', array(
'label' => __('Font Style', 'arcstheme'),
'section' => 'h2_typography_section',
'type' => 'select',
'choices' => array(
'normal' => __('Normal', 'arcstheme'),
'italic' => __('Italic', 'arcstheme'),
),
));
$wp_customize->add_setting('h2_font_weight', array(
'default' => '400',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h2_font_weight', array(
'label' => __('Font Weight', 'arcstheme'),
'section' => 'h2_typography_section',
));
$wp_customize->add_setting('h2_font_color', array(
'default' => '#000000', // Set your default color
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control('h2_font_color', array(
'label' => __('h2 Font Color', 'arcstheme'),
'section' => 'h2_typography_section',
'type' => 'color',
));
//h3
$wp_customize->add_section('h3_typography_section', array(
'title' => __('h3 Typography', 'arcstheme'),
'priority' => 30,
));
$wp_customize->add_setting('h3_font_source', array(
'default' => 'google', // 'google' or 'custom'
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h3_font_source', array(
'label' => __('Font Source', 'arcstheme'),
'section' => 'h3_typography_section',
'type' => 'radio',
'choices' => array(
'google' => __('Google Fonts', 'arcstheme'),
'custom' => __('Custom Fonts', 'arcstheme'),
),
));
$wp_customize->add_setting('h3_google_font', array(
'default' => 'Open Sans, sans-serif',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h3_google_font', array(
'label' => __('Google Font', 'arcstheme'),
'section' => 'h3_typography_section',
'type' => 'select',
'choices' => array(
'Open Sans, sans-serif' => 'Open Sans',
'Roboto, sans-serif' => 'Roboto',
'Lato, sans-serif' => 'Lato',
'Montserrat, sans-serif' => 'Montserrat',
'Inter, sans-serif'=>'Inter',
'Roboto Condensed, sans-serif'=>'Roboto Condensed',
'Single Day, cursive'=>'Single Day',
),
'active_callback' => function () use ($wp_customize) {
return $wp_customize->get_setting('h3_font_source')->value() === 'google';
},
));
$wp_customize->add_setting('h3_custom_font', array(
'default' => 'Arial, sans-serif',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h3_custom_font', array(
'label' => __('Custom Font', 'arcstheme'),
'section' => 'h3_typography_section',
'type' => 'text',
'active_callback' => function () use ($wp_customize) {
return $wp_customize->get_setting('h3_font_source')->value() === 'custom';
},
));
$wp_customize->add_setting('h3_font_size', array(
'default' => '20px',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h3_font_size', array(
'label' => __('Font Size', 'arcstheme'),
'section' => 'h3_typography_section',
));
$wp_customize->add_setting('h3_font_style', array(
'default' => 'normal',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h3_font_style', array(
'label' => __('Font Style', 'arcstheme'),
'section' => 'h3_typography_section',
'type' => 'select',
'choices' => array(
'normal' => __('Normal', 'arcstheme'),
'italic' => __('Italic', 'arcstheme'),
),
));
$wp_customize->add_setting('h3_font_weight', array(
'default' => '400',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h3_font_weight', array(
'label' => __('Font Weight', 'arcstheme'),
'section' => 'h3_typography_section',
));
$wp_customize->add_setting('h3_font_color', array(
'default' => '#000000', // Set your default color
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control('h3_font_color', array(
'label' => __('h3 Font Color', 'arcstheme'),
'section' => 'h3_typography_section',
'type' => 'color',
));
//h4
$wp_customize->add_section('h4_typography_section', array(
'title' => __('h4 Typography', 'arcstheme'),
'priority' => 30,
));
$wp_customize->add_setting('h4_font_source', array(
'default' => 'google', // 'google' or 'custom'
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h4_font_source', array(
'label' => __('Font Source', 'arcstheme'),
'section' => 'h4_typography_section',
'type' => 'radio',
'choices' => array(
'google' => __('Google Fonts', 'arcstheme'),
'custom' => __('Custom Fonts', 'arcstheme'),
),
));
$wp_customize->add_setting('h4_google_font', array(
'default' => 'Open Sans, sans-serif',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h4_google_font', array(
'label' => __('Google Font', 'arcstheme'),
'section' => 'h4_typography_section',
'type' => 'select',
'choices' => array(
'Open Sans, sans-serif' => 'Open Sans',
'Roboto, sans-serif' => 'Roboto',
'Lato, sans-serif' => 'Lato',
'Montserrat, sans-serif' => 'Montserrat',
'Inter, sans-serif'=>'Inter',
'Roboto Condensed, sans-serif'=>'Roboto Condensed',
'Single Day, cursive'=>'Single Day',
),
'active_callback' => function () use ($wp_customize) {
return $wp_customize->get_setting('h4_font_source')->value() === 'google';
},
));
$wp_customize->add_setting('h4_custom_font', array(
'default' => 'Arial, sans-serif',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h4_custom_font', array(
'label' => __('Custom Font', 'arcstheme'),
'section' => 'h4_typography_section',
'type' => 'text',
'active_callback' => function () use ($wp_customize) {
return $wp_customize->get_setting('h4_font_source')->value() === 'custom';
},
));
$wp_customize->add_setting('h4_font_size', array(
'default' => '16px',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h4_font_size', array(
'label' => __('Font Size', 'arcstheme'),
'section' => 'h4_typography_section',
));
$wp_customize->add_setting('h4_font_style', array(
'default' => 'normal',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h4_font_style', array(
'label' => __('Font Style', 'arcstheme'),
'section' => 'h4_typography_section',
'type' => 'select',
'choices' => array(
'normal' => __('Normal', 'arcstheme'),
'italic' => __('Italic', 'arcstheme'),
),
));
$wp_customize->add_setting('h4_font_weight', array(
'default' => '400',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h4_font_weight', array(
'label' => __('Font Weight', 'arcstheme'),
'section' => 'h4_typography_section',
));
$wp_customize->add_setting('h4_font_color', array(
'default' => '#000000', // Set your default color
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control('h4_font_color', array(
'label' => __('h4 Font Color', 'arcstheme'),
'section' => 'h4_typography_section',
'type' => 'color',
));
//h5
$wp_customize->add_section('h5_typography_section', array(
'title' => __('h5 Typography', 'arcstheme'),
'priority' => 30,
));
$wp_customize->add_setting('h5_font_source', array(
'default' => 'google', // 'google' or 'custom'
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h5_font_source', array(
'label' => __('Font Source', 'arcstheme'),
'section' => 'h5_typography_section',
'type' => 'radio',
'choices' => array(
'google' => __('Google Fonts', 'arcstheme'),
'custom' => __('Custom Fonts', 'arcstheme'),
),
));
$wp_customize->add_setting('h5_google_font', array(
'default' => 'Open Sans, sans-serif',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h5_google_font', array(
'label' => __('Google Font', 'arcstheme'),
'section' => 'h5_typography_section',
'type' => 'select',
'choices' => array(
'Open Sans, sans-serif' => 'Open Sans',
'Roboto, sans-serif' => 'Roboto',
'Lato, sans-serif' => 'Lato',
'Montserrat, sans-serif' => 'Montserrat',
'Inter, sans-serif'=>'Inter',
'Roboto Condensed, sans-serif'=>'Roboto Condensed',
'Single Day, cursive'=>'Single Day',
),
'active_callback' => function () use ($wp_customize) {
return $wp_customize->get_setting('h5_font_source')->value() === 'google';
},
));
$wp_customize->add_setting('h5_custom_font', array(
'default' => 'Arial, sans-serif',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h5_custom_font', array(
'label' => __('Custom Font', 'arcstheme'),
'section' => 'h5_typography_section',
'type' => 'text',
'active_callback' => function () use ($wp_customize) {
return $wp_customize->get_setting('h5_font_source')->value() === 'custom';
},
));
$wp_customize->add_setting('h5_font_size', array(
'default' => '16px',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h5_font_size', array(
'label' => __('Font Size', 'arcstheme'),
'section' => 'h5_typography_section',
));
$wp_customize->add_setting('h5_font_style', array(
'default' => 'normal',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h5_font_style', array(
'label' => __('Font Style', 'arcstheme'),
'section' => 'h5_typography_section',
'type' => 'select',
'choices' => array(
'normal' => __('Normal', 'arcstheme'),
'italic' => __('Italic', 'arcstheme'),
),
));
$wp_customize->add_setting('h5_font_weight', array(
'default' => '400',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h5_font_weight', array(
'label' => __('Font Weight', 'arcstheme'),
'section' => 'h5_typography_section',
));
$wp_customize->add_setting('h5_font_color', array(
'default' => '#000000', // Set your default color
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control('h5_font_color', array(
'label' => __('h5 Font Color', 'arcstheme'),
'section' => 'h5_typography_section',
'type' => 'color',
));
//h6
$wp_customize->add_section('h6_typography_section', array(
'title' => __('h6 Typography', 'arcstheme'),
'priority' => 30,
));
$wp_customize->add_setting('h6_font_source', array(
'default' => 'google', // 'google' or 'custom'
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h6_font_source', array(
'label' => __('Font Source', 'arcstheme'),
'section' => 'h6_typography_section',
'type' => 'radio',
'choices' => array(
'google' => __('Google Fonts', 'arcstheme'),
'custom' => __('Custom Fonts', 'arcstheme'),
),
));
$wp_customize->add_setting('h6_google_font', array(
'default' => 'Open Sans, sans-serif',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h6_google_font', array(
'label' => __('Google Font', 'arcstheme'),
'section' => 'h6_typography_section',
'type' => 'select',
'choices' => array(
'Open Sans, sans-serif' => 'Open Sans',
'Roboto, sans-serif' => 'Roboto',
'Lato, sans-serif' => 'Lato',
'Montserrat, sans-serif' => 'Montserrat',
'Inter, sans-serif'=>'Inter',
'Roboto Condensed, sans-serif'=>'Roboto Condensed',
'Single Day, cursive'=>'Single Day',
),
'active_callback' => function () use ($wp_customize) {
return $wp_customize->get_setting('h6_font_source')->value() === 'google';
},
));
$wp_customize->add_setting('h6_custom_font', array(
'default' => 'Arial, sans-serif',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h6_custom_font', array(
'label' => __('Custom Font', 'arcstheme'),
'section' => 'h6_typography_section',
'type' => 'text',
'active_callback' => function () use ($wp_customize) {
return $wp_customize->get_setting('h6_font_source')->value() === 'custom';
},
));
$wp_customize->add_setting('h6_font_size', array(
'default' => '16px',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h6_font_size', array(
'label' => __('Font Size', 'arcstheme'),
'section' => 'h6_typography_section',
));
$wp_customize->add_setting('h6_font_style', array(
'default' => 'normal',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h6_font_style', array(
'label' => __('Font Style', 'arcstheme'),
'section' => 'h6_typography_section',
'type' => 'select',
'choices' => array(
'normal' => __('Normal', 'arcstheme'),
'italic' => __('Italic', 'arcstheme'),
),
));
$wp_customize->add_setting('h6_font_weight', array(
'default' => '400',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('h6_font_weight', array(
'label' => __('Font Weight', 'arcstheme'),
'section' => 'h6_typography_section',
));
$wp_customize->add_setting('h6_font_color', array(
'default' => '#000000', // Set your default color
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control('h6_font_color', array(
'label' => __('h6 Font Color', 'arcstheme'),
'section' => 'h6_typography_section',
'type' => 'color',
));
}
// Call the function to add our custom section and controls
add_action('customize_register', 'customize_heading_typography');
//banner section
function custom_banner_customizer_section($wp_customize) {
$wp_customize->add_section('custom_banner_section', array(
'title' => __('Banner Settings', 'arcstheme'),
'priority' => 30,
));
// Background Image
$wp_customize->add_setting('banner_background_image', array(
'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'banner_background_image', array(
'label' => __('Background Image', 'arcstheme'),
'section' => 'custom_banner_section',
'settings' => 'banner_background_image',
)));
// Background Color
$wp_customize->add_setting('banner_background_color', array(
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'banner_background_color', array(
'label' => __('Background Color', 'arcstheme'),
'section' => 'custom_banner_section',
'settings' => 'banner_background_color',
)));
// Background Gradient
$wp_customize->add_setting('banner_background_gradient', array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('banner_background_gradient', array(
'label' => __('Background Gradient', 'arcstheme'),
'section' => 'custom_banner_section',
'type' => 'text', // You might want to use a custom control for gradient input
));
// Background Position
$wp_customize->add_setting('banner_background_position', array(
'default' => 'center center',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('banner_background_position', array(
'label' => __('Background Position', 'arcstheme'),
'section' => 'custom_banner_section',
'type' => 'text',
));
// Background Size
$wp_customize->add_setting('banner_background_size', array(
'default' => 'cover',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('banner_background_size', array(
'label' => __('Background Size', 'arcstheme'),
'section' => 'custom_banner_section',
'type' => 'text',
));
// Background Repeat
$wp_customize->add_setting('banner_background_repeat', array(
'default' => 'no-repeat',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('banner_background_repeat', array(
'label' => __('Background Repeat', 'arcstheme'),
'section' => 'custom_banner_section',
'type' => 'text',
));
// Background Attachment
$wp_customize->add_setting('banner_background_attachment', array(
'default' => 'scroll',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('banner_background_attachment', array(
'label' => __('Background Attachment', 'arcstheme'),
'section' => 'custom_banner_section',
'type' => 'text',
));
// Dynamic Heading
$wp_customize->add_setting('banner_dynamic_heading', array(
'default' => 'Your Default Heading',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('banner_dynamic_heading', array(
'label' => __('Dynamic Heading', 'arcstheme'),
'section' => 'custom_banner_section',
'type' => 'text',
));
// Dynamic Text
$wp_customize->add_setting('banner_dynamic_text', array(
'default' => 'Your Default Text',
'sanitize_callback' => 'wp_kses_post',
));
$wp_customize->add_control('banner_dynamic_text', array(
'label' => __('Dynamic Text', 'arcstheme'),
'section' => 'custom_banner_section',
'type' => 'textarea',
));
}
add_action('customize_register', 'custom_banner_customizer_section');
/*header*/
function customize_header_background($wp_customize) {
$wp_customize->add_section('header_background_section', array(
'title' => __('header Background', 'arcstheme'),
'priority' => 30,
));
// Background Color
$wp_customize->add_setting('header_background_color', array(
'default' => '#3498db',
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_background_color', array(
'label' => __('Background Color', 'arcstheme'),
'section' => 'header_background_section',
)));
// Background Gradient
$wp_customize->add_setting('header_background_gradient', array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('header_background_gradient', array(
'label' => __('Background Gradient', 'arcstheme'),
'section' => 'header_background_section',
));
// Background Image
$wp_customize->add_setting('header_background_image', array(
'default' => '',
'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'header_background_image', array(
'label' => __('Background Image', 'arcstheme'),
'section' => 'header_background_section',
)));
// Background Position
$wp_customize->add_setting('header_background_position', array(
'default' => 'center center',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('header_background_position', array(
'label' => __('Background Position', 'arcstheme'),
'section' => 'header_background_section',
));
// Background Size
$wp_customize->add_setting('header_background_size', array(
'default' => 'cover',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('header_background_size', array(
'label' => __('Background Size', 'arcstheme'),
'section' => 'header_background_section',
));
// Background Attachment
$wp_customize->add_setting('header_background_attachment', array(
'default' => 'fixed',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('header_background_attachment', array(
'label' => __('Background Attachment', 'arcstheme'),
'section' => 'header_background_section',
));
// Background Opacity
$wp_customize->add_setting('header_background_opacity', array(
'default' => 1,
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('header_background_opacity', array(
'label' => __('Background Opacity', 'arcstheme'),
'section' => 'header_background_section',
));
}
add_action('customize_register', 'customize_header_background');
// Enable support for custom background in ARCSTheme
function arcstheme_setup_custom_background() {
$args = array(
'default-color' => 'ffffff', // Default background color
'default-image' => '', // Default background image
'default-repeat' => 'repeat', // Default background repeat
'default-position-x' => 'left', // Default horizontal background position
'default-position-y' => 'top', // Default vertical background position
'default-size' => 'auto', // Default background size
'default-attachment' => 'scroll', // Default background attachment
'wp-head-callback' => '_custom_background_cb',
);
add_theme_support( 'custom-background', $args );
}
add_action( 'after_setup_theme', 'arcstheme_setup_custom_background' );
// Enqueue comment reply script in ARCSTheme
function arcstheme_enqueue_comment_reply_script() {
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'arcstheme_enqueue_comment_reply_script' );
// Enqueue editor style for ARCSTheme
function arcstheme_editor_styles() {
add_editor_style( 'editor-style.css' ); // Replace 'editor-style.css' with the path to your editor stylesheet
}
add_action( 'admin_init', 'arcstheme_editor_styles' );
// Enable support for wide alignments in ARCSTheme
function arcstheme_setup_wide_align() {
add_theme_support( 'align-wide' );
}
add_action( 'after_setup_theme', 'arcstheme_setup_wide_align' );
// Enable support for custom header in ARCSTheme
function arcstheme_setup_custom_header() {
$args = array(
'default-image' => '',
'width' => 1200,
'height' => 280,
'flex-height' => true,
'flex-width' => true,
'uploads' => true,
'header-text' => false,
);
add_theme_support( 'custom-header', $args );
}
add_action( 'after_setup_theme', 'arcstheme_setup_custom_header' );
// Enable support for HTML5 features in ARCSTheme
function arcstheme_setup_html5() {
$args = array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
'style',
'script',
);
add_theme_support( 'html5', $args );
}
add_action( 'after_setup_theme', 'arcstheme_setup_html5' );
// Enable support for responsive embeds in ARCSTheme
function arcstheme_setup_responsive_embeds() {
add_theme_support( 'responsive-embeds' );
}
add_action( 'after_setup_theme', 'arcstheme_setup_responsive_embeds' );
// Enable support for WordPress block styles in ARCSTheme
function arcstheme_setup_block_styles() {
add_theme_support( 'wp-block-styles' );
}
add_action( 'after_setup_theme', 'arcstheme_setup_block_styles' );
// Register custom block patterns in ARCSTheme
function arcstheme_register_block_patterns() {
register_block_pattern(
'arcstheme/custom-pattern-one', // Unique pattern name
array(
'title' => __( 'Custom Pattern One', 'arcstheme' ), // Pattern title
'description' => __( 'Description of custom pattern one.', 'arcstheme' ), // Pattern description
'content' => '', // Pattern content
'categories' => array( 'text' ), // Pattern categories
'keywords' => array( 'custom', 'pattern', 'one' ), // Pattern keywords
)
);
// Add more custom block patterns as needed
}
add_action( 'init', 'arcstheme_register_block_patterns' );
// Register custom block styles in ARCSTheme
function arcstheme_register_block_styles() {
// Register a custom block style for the paragraph block
register_block_style(
'core/paragraph', // Block name
array(
'name' => 'arcstheme-custom-paragraph-style', // Unique style name
'label' => __( 'Custom Paragraph Style', 'arcstheme' ), // Style label
'style_handle' => 'arcstheme-custom-paragraph-style-css', // Handle for the custom CSS
)
);
// Enqueue the custom block style CSS
wp_register_style(
'arcstheme-custom-paragraph-style-css', // Handle
get_template_directory_uri() . '/css/custom-paragraph-style.css', // Path to the CSS file
array(), // Dependencies
'1.0', // Version
'all' // Media
);
// Add more custom block styles as needed
}
add_action( 'init', 'arcstheme_register_block_styles' );