'48',
'width' => '150',
'flex-width' => true,
'flex-height' => true
]);
add_theme_support( 'customize-selective-refresh-widgets' );
add_theme_support( 'custom-background', [
'default-color' => '#ffffff',
'default-image' => ''
] );
//Woocommerce Support
add_theme_support( 'woocommerce', [
'thumbnail_image_width' => 150,
'single_image_width' => 300,
'product_grid' => [
'default_rows' => 3,
'min_rows' => 2,
'max_rows' => 8,
'default_columns' => 4,
'min_columns' => 2,
'max_columns' => 5
]
]);
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
//Gutenberg Support
add_theme_support( 'wp-block-styles' );
add_theme_support( 'responsive-embeds' );
add_theme_support( 'align-wide' );
add_theme_support( 'align-full' );
register_nav_menus([
'primary' => esc_html__('Primary', 'bansta'),
'off-canvas' => esc_html__( 'Off-canvas', 'bansta' )
]);
add_editor_style( get_stylesheet_uri() );
global $content_width;
if ( ! isset ( $content_width) ) {
$content_width = 690;
}
}
}
add_action( 'after_setup_theme', 'bansta_setup' );
if ( ! function_exists( 'bansta_widgets_init' ) ) {
function bansta_widgets_init() {
//main sidebar
register_sidebar([
'name' => esc_html__('Primary Sidebar', 'bansta'),
'description' => esc_html__('Add Widget here', 'bansta'),
'id' => 'sidebar',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => ''
]);
//fisrt footer
register_sidebar([
'name' => __('Footer 1', 'bansta'),
'description' => __('Add Widget Here', 'bansta'),
'id' => 'footer-1',
'before_widget' => '',
'after_widget' => '
',
'before_title' => ''
]);
//second Footer
register_sidebar([
'name' => __('Footer 2', 'bansta'),
'description' => __('Add Widget Here', 'bansta'),
'id' => 'footer-2',
'before_widget' => '',
'after_widget' => '
',
'before_title' => ''
]);
//third footer
register_sidebar([
'name' => __('Footer 3', 'bansta'),
'description' => __('Add Widget Here', 'bansta'),
'id' => 'footer-3',
'before_widget' => '',
'after_widget' => '
',
'before_title' => ''
]);
//fourth footer
register_sidebar([
'name' => __('Footer 4', 'bansta'),
'description' => __('Add Widget Here', 'bansta'),
'id' => 'footer-4',
'before_widget' => '',
'after_widget' => '
',
'before_title' => ''
]);
}
}
add_action( 'widgets_init', 'bansta_widgets_init' );
if ( ! function_exists( 'bansta_scripts') ) {
function bansta_scripts() {
wp_enqueue_style( 'bansta-style', get_stylesheet_uri(), [], BANSTA_THEME_VER );
wp_enqueue_style( 'bansta-custom-style', get_stylesheet_directory_uri() . '/assets/css/custom-style.css', [], BANSTA_THEME_VER );
wp_enqueue_style( 'bansta-block-style', get_template_directory_uri() . '/assets/blocks/gutenberg-editor.css', [], BANSTA_THEME_VER );
wp_enqueue_style( 'font-awesome-style', get_template_directory_uri() . '/assets/images/icons/font-awesome/font-awesome.css', [], BANSTA_THEME_VER );
wp_enqueue_script( 'bansta-dark-mode', get_template_directory_uri() . '/assets/js/dark-mode.js', [], BANSTA_THEME_VER, true );
wp_enqueue_script( 'bansta-search-icon', get_template_directory_uri() . '/assets/js/search-icon.js', [], BANSTA_THEME_VER, true );
wp_enqueue_script( 'bansta-custom-script', get_template_directory_uri() . '/assets/js/custom.js', ['jquery'], BANSTA_THEME_VER, true );
wp_enqueue_script( 'bansta-navigation', get_template_directory_uri() . '/assets/js/navigation.js', ['jquery'], BANSTA_THEME_VER, true );
wp_localize_script( 'bansta-navigation', 'bansta_nav_args', [
'icon' => '',
'expand' => esc_html__( 'menu is expanded', 'bansta' ),
'collapse' => esc_html__( 'menu is collapsed', 'bansta' )
] );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
}
add_action( 'wp_enqueue_scripts', 'bansta_scripts' );
if ( ! function_exists( 'bansta_block_editor_assets' ) ) {
function bansta_block_editor_assets() {
wp_enqueue_style( 'bansta-block-editor-style', get_theme_file_uri( '/assets/blocks/editor-style.css' ) );
}
}
add_action( 'enqueue_block_editor_assets', 'bansta_block_editor_assets' );
if ( ! function_exists( 'bansta_woocommerce_init' ) ) {
function bansta_woocommerce_init() {
wp_enqueue_style( 'bansta-woocommerce-style', get_stylesheet_directory_uri() . '/assets/css/woocommerce.css', [], BANSTA_THEME_VER );
}
}
add_action( 'woocommerce_init', 'bansta_woocommerce_init' );
if ( ! function_exists( 'bansta_elementor_register' ) ) {
function bansta_elementor_register( $elementor_theme_manager ) {
$elementor_theme_manager->register_location( 'home' );
}
}
add_action( 'elementor/theme/register_locations', 'bansta_elementor_register' );
require get_template_directory() . '/inc/tags.php';
require get_template_directory() . '/inc/template-classes.php';
require get_template_directory() . '/inc/customizer/customizer.php';
require get_template_directory() . '/inc/common.php';
require get_template_directory() . '/inc/theme.php';