esc_html__('Sidebar', 'allinone'),
'id' => 'sidebar-1',
'description' => esc_html__('Add widgets here.', 'allinone'),
'before_widget' => '
',
'before_title' => '',
));
register_sidebar( array(
'name' => esc_html__('Offcanvas Widget', 'allinone'),
'id' => 'allinone-offcanvas-widget',
'description' => esc_html__('Add widgets here.', 'allinone'),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
));
$twp_allinone_home_sections_1 = get_theme_mod('twp_allinone_home_sections_1', json_encode($allinone_default['twp_allinone_home_sections_1']));
$twp_allinone_home_sections_1 = json_decode($twp_allinone_home_sections_1);
foreach( $twp_allinone_home_sections_1 as $allinone_home_section ){
$home_section_type = isset( $allinone_home_section->home_section_type ) ? $allinone_home_section->home_section_type : '';
switch( $home_section_type ){
case 'home-widget-area':
$ed_home_widget_area = isset( $allinone_home_section->section_ed ) ? $allinone_home_section->section_ed : '';
if( $ed_home_widget_area == 'yes' ){
register_sidebar(array(
'name' => esc_html__('Front Page Widget Area', 'allinone'),
'id' => 'front-page-widget-area-1',
'description' => esc_html__('Add widgets here.', 'allinone'),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
));
}
break;
default:
break;
}
}
$allinone_default = allinone_get_default_theme_options();
$footer_column_layout = absint(get_theme_mod('footer_column_layout', $allinone_default['footer_column_layout']));
for( $i = 0; $i < $footer_column_layout; $i++ ){
if ($i == 0) {
$count = esc_html__('One', 'allinone');
}
if ($i == 1) {
$count = esc_html__('Two', 'allinone');
}
if ($i == 2) {
$count = esc_html__('Three', 'allinone');
}
if ($i == 3) {
$count = esc_html__('Four', 'allinone');
}
register_sidebar(array(
'name' => esc_html__('Footer Widget ', 'allinone') . $count,
'id' => 'allinone-footer-widget-' . $i,
'description' => esc_html__('Add widgets here.', 'allinone'),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
));
}
}
add_action('widgets_init', 'allinone_widgets_init');
require get_template_directory() . '/inc/widgets/widget-base.php';
require get_template_directory() . '/inc/widgets/author.php';
require get_template_directory() . '/inc/widgets/home-page-widget.php';
require get_template_directory() . '/inc/widgets/home-page-carousel-widget.php';
require get_template_directory() . '/inc/widgets/home-page-banner-slider-widget.php';
require get_template_directory() . '/inc/widgets/social-link.php';
require get_template_directory() . '/inc/widgets/featured-category-widget.php';
require get_template_directory() . '/inc/widgets/home-page-double-cat-widget.php';
require get_template_directory() . '/inc/widgets/home-page-youtube-video.php';
require get_template_directory() . '/inc/widgets/tab-posts.php';