<?php
/**
* Widget Functions.
*
* @package Electrician Company
*/

function electrician_company_widgets_init(){

	register_sidebar(array(
	    'name' => esc_html__('Main Sidebar', 'electrician-company'),
	    'id' => 'sidebar-1',
	    'description' => esc_html__('Add widgets here.', 'electrician-company'),
	    'before_widget' => '<div id="%1$s" class="widget %2$s">',
	    'after_widget' => '</div>',
	    'before_title' => '<h3 class="widget-title"><span>',
	    'after_title' => '</span></h3>',
	));


    $electrician_company_default = electrician_company_get_default_theme_options();
    $electrician_company_electrician_company_footer_column_layout = absint( get_theme_mod( 'electrician_company_footer_column_layout',$electrician_company_default['electrician_company_footer_column_layout'] ) );

    for( $electrician_company_i = 0; $electrician_company_i < $electrician_company_electrician_company_footer_column_layout; $electrician_company_i++ ){
    	
    	if( $electrician_company_i == 0 ){ $electrician_company_count = esc_html__('One','electrician-company'); }
    	if( $electrician_company_i == 1 ){ $electrician_company_count = esc_html__('Two','electrician-company'); }
    	if( $electrician_company_i == 2 ){ $electrician_company_count = esc_html__('Three','electrician-company'); }

	    register_sidebar( array(
	        'name' => esc_html__('Footer Widget ', 'electrician-company').$electrician_company_count,
	        'id' => 'electrician-company-footer-widget-'.$electrician_company_i,
	        'description' => esc_html__('Add widgets here.', 'electrician-company'),
	        'before_widget' => '<div id="%1$s" class="widget %2$s">',
	        'after_widget' => '</div>',
	        'before_title' => '<h2 class="widget-title">',
	        'after_title' => '</h2>',
	    ));
	}

}

add_action('widgets_init', 'electrician_company_widgets_init');