<?php
/**
* Widget Functions.
*
* @package Omega Design Agency
*/

function omega_design_agency_widgets_init(){

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


    $omega_design_agency_default = omega_design_agency_get_default_theme_options();
    $omega_design_agency_footer_column_layout = absint( get_theme_mod( 'omega_design_agency_footer_column_layout',$omega_design_agency_default['omega_design_agency_footer_column_layout'] ) );

    for( $omega_design_agency_i = 0; $omega_design_agency_i < $omega_design_agency_footer_column_layout; $omega_design_agency_i++ ){
    	
    	if( $omega_design_agency_i == 0 ){ $omega_design_agency_count = esc_html__('One','omega-design-agency'); }
    	if( $omega_design_agency_i == 1 ){ $omega_design_agency_count = esc_html__('Two','omega-design-agency'); }
    	if( $omega_design_agency_i == 2 ){ $omega_design_agency_count = esc_html__('Three','omega-design-agency'); }

	    register_sidebar( array(
	        'name' => esc_html__('Footer Widget ', 'omega-design-agency').$omega_design_agency_count,
	        'id' => 'omega-design-agency-footer-widget-'.$omega_design_agency_i,
	        'description' => esc_html__('Add widgets here.', 'omega-design-agency'),
	        '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', 'omega_design_agency_widgets_init');