<?php
/**
 * Register widget area.
 * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
 */

if ( ! function_exists( 'prime_business_widgets_init' ) ) :

function prime_business_widgets_init() {
	register_sidebar( array(
		'name'          => esc_html__( 'Default Sidebar', 'prime-business' ),
		'id'            => 'prime-business-main-sidebar',
		'description'   => esc_html__( 'Add widgets here to appear in your single post sidebar area.', 'prime-business' ),
		'before_widget' => '<div id="%1$s" class="%2$s sidebar-widgetarea widgetarea">',
		'after_widget'  => '</div><!-- /.sidebar-widgetarea -->',
		'before_title'  => '<h3 class="widget-title">',
		'after_title'   => '</h3>',
	) );

	register_sidebar( array(
		'name'          => esc_html__( 'Page Sidebar', 'prime-business' ),
		'id'            => 'prime-business-page-sidebar',
		'description'   => esc_html__( 'Add widgets here to appear in your single page sidebar area.', 'prime-business' ),
		'before_widget' => '<div id="%1$s" class="%2$s sidebar-widgetarea widgetarea">',
		'after_widget'  => '</div><!-- /.sidebar-widgetarea -->',
		'before_title'  => '<h3 class="widget-title">',
		'after_title'   => '</h3>',
	) );

	for ( $i=1; $i < 4; $i++ ) {

		register_sidebar( array(
			/* translators: %d: Footer numbers */
			'name'          =>  sprintf( esc_html__( 'Footer %d', 'prime-business' ), $i ),
			'id'            => "prime-business-footer-$i",
			'description'   => esc_html__( 'Add widgets here to appear on your footer section.', 'prime-business' ),
			'before_widget' => '<div id="%1$s" class="%2$s four columns widgetarea">',
			'after_widget'  => '</div><!-- /.widgetarea four columns -->',
			'before_title'  => '<h3 class="widget-title">',
			'after_title'   => '</h3>',
		) );

	}

	register_sidebar( array(
		'name'          => esc_html__( 'Top bar: Address', 'prime-business' ),
		'id'            => 'prime-business-topbar-address',
		'description'   => esc_html__( 'Add a Text widget here to appear in your left topbar address area.', 'prime-business' ),
		'before_widget' => '<span class="address topbar-widget">',
		'after_widget'  => '</span>',
		'before_title'  => '<span class="topbar-title widget-title">',
		'after_title'   => '</span>',
	) );

	register_sidebar( array(
		'name'          => esc_html__( 'Top bar: Office Hours', 'prime-business' ),
		'id'            => 'prime-business-topbar-office-hours',
		'description'   => esc_html__( 'Add a Text widget here to appear in your left topbar Office Hours area.', 'prime-business' ),
		'before_widget' => '<span class="office-hour topbar-widget">',
		'after_widget'  => '</span>',
		'before_title'  => '<span class="topbar-title widget-title">',
		'after_title'   => '</span>',
	) );

	register_sidebar( array(
		'name'          => esc_html__( 'Top bar: Phone', 'prime-business' ),
		'id'            => 'prime-business-topbar-phone',
		'description'   => esc_html__( 'Add a Text widget here to appear in your left topbar call us area.', 'prime-business' ),
		'before_widget' => '<span class="phone topbar-widget">',
		'after_widget'  => '</span>',
		'before_title'  => '<span class="topbar-title widget-title">',
		'after_title'   => '</span>',
	) );

	register_sidebar( array(
		'name'          => esc_html__( 'Top bar: Email', 'prime-business' ),
		'id'            => 'prime-business-topbar-email',
		'description'   => esc_html__( 'Add a Text widget here to appear in your right topbar Email Address area.', 'prime-business' ),
		'before_widget' => '<span class="e-mail topbar-widget">',
		'after_widget'  => '</span>',
		'before_title'  => '<span class="topbar-title widget-title">',
		'after_title'   => '</span>',
	) );
}

endif;

add_action( 'widgets_init', 'prime_business_widgets_init' );
