<?php
/**
* Widget Functions.
*
* @package Omega Blogger
*/

function omega_blogger_widgets_init(){

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

	register_sidebar(array(
	    'name' => esc_html__('Home Page Sidebar', 'omega-blogger'),
	    'id' => 'sidebar-2',
	    'description' => esc_html__('Add widgets here.', 'omega-blogger'),
	    '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_blogger_default = omega_blogger_get_default_theme_options();
    $omega_blogger_omega_blogger_footer_column_layout = absint( get_theme_mod( 'omega_blogger_footer_column_layout',$omega_blogger_default['omega_blogger_footer_column_layout'] ) );

    for( $omega_blogger_i = 0; $omega_blogger_i < $omega_blogger_omega_blogger_footer_column_layout; $omega_blogger_i++ ){
    	
    	if( $omega_blogger_i == 0 ){ $omega_blogger_count = esc_html__('One','omega-blogger'); }
    	if( $omega_blogger_i == 1 ){ $omega_blogger_count = esc_html__('Two','omega-blogger'); }
    	if( $omega_blogger_i == 2 ){ $omega_blogger_count = esc_html__('Three','omega-blogger'); }

	    register_sidebar( array(
	        'name' => esc_html__('Footer Widget ', 'omega-blogger').$omega_blogger_count,
	        'id' => 'omega-blogger-footer-widget-'.$omega_blogger_i,
	        'description' => esc_html__('Add widgets here.', 'omega-blogger'),
	        '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_blogger_widgets_init');