<?php
/*
Theme Designed By: Meysam Hosseinkhani
Email: Meysam98@Gmail.com
Author Website: Hosseinkhani.ir
*/
   // Exit if accessed directly
   if (!defined('ABSPATH')) {
    exit;
}
global $di_data;

// If Dynamic Sidebar Exists

if(function_exists('register_sidebar')) {
   
    register_sidebar(array(
    'name' => __('Products and product archive Sidebar','dina-kala'),
    'id' => 'shop-sidebar',
    'description' => __('Products and product archive Sidebar','dina-kala'),
    'before_widget' => '<div id="%1$s" class="shadow-box wid-content %2$s">',
    'before_title' => '<div class="wid-title"><h3>',
    'after_title' => '</h3></div>',
    'after_widget' => '</div>'
    ));

    if($di_data['product_page_side']) {
        register_sidebar(array(
        'name' => __('Products Sidebar','dina-kala'),
        'id' => 'product-sidebar',
        'description' => __('Products sidebar','dina-kala'),
        'before_widget' => '<div id="%1$s" class="shadow-box wid-content %2$s">',
        'before_title' => '<div class="wid-title"><h3>',
        'after_title' => '</h3></div>',
        'after_widget' => '</div>'
        ));
    }

   register_sidebar(array(
   'name' => __('Site Sidebar','dina-kala'),
   'id' => 'site-sidebar',
   'description' => __('Site sidebar','dina-kala'),
   'before_widget' => '<div id="%1$s" class="shadow-box wid-content %2$s">',
    'before_title' => '<div class="wid-title"><h3>',
    'after_title' => '</h3></div>',
    'after_widget' => '</div>'
    ));

    $footer_widgets = (int)$di_data['footer_widgets'];
    for ($x = 1; $x <= $footer_widgets; $x++) {
        register_sidebar(array(
        'name' => __( 'Footer ', 'dina-kala' ).$x,
        'id' => 'footer-'.$x,
        'description' => __( 'Footer Widget ', 'dina-kala' ).$x,
        'before_widget' => '<div id="%1$s" class="%2$s">',
        'before_title' => '<h3 class="fwidget-title">',
        'after_title' => '</h3>',
        'after_widget' => '</div>'
        ));
    }
}   