%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/higroup/wp-content/themes/evenex/core/helpers/functions/
Upload File :
Create Path :
Current File : /var/www/html/higroup/wp-content/themes/evenex/core/helpers/functions/global.php

<?php if (!defined('ABSPATH')) die('Direct access forbidden.');
/**
 * helper functions
 */

// simply echo the variable
// ----------------------------------------------------------------------------------------
use \Etn\Utils\Helper as Helper;
function evenex_return( $s ) {

	return evenex_kses($s);
}

//css unit check
function evenex_style_unit( $data ) {
   $css_units = ["px","mm","in","pt","pc","em","vw","%","cm"];
   $footer_padding_top_unit = substr($data, -2);
   $footer_padding_top_unit_percent = substr($data, -1);
   if(in_array($footer_padding_top_unit,$css_units) || in_array($footer_padding_top_unit_percent,$css_units)){
    return $data;
   }else{
     return (int)$data."px";
   }

   return $data;
}

// return the specific value from theme options/ customizer/ etc
// ----------------------------------------------------------------------------------------
function evenex_option( $key, $default_value = '', $method = 'customizer' ) {
	if ( defined( 'DEVM' ) ) {
		switch ( $method ) {
			case 'customizer':
				$value = devm_theme_option( $key );
				break;
			default:
				$value = '';
				break;
		}
		return (!isset($value) || $value == '') ? $default_value :  $value;
	}
	return $default_value;
}


// return the specific value from metabox
// ----------------------------------------------------------------------------------------
function evenex_meta_option( $postid, $key, $default_value = '' ) {
	if ( defined( 'DEVM' ) ) {
		$value = devm_meta_option($postid, $key, $default_value);
	}
	return (!isset($value) || $value == '') ? $default_value :  $value;
}

// extract unyson image data from option value in a much simple way
// ----------------------------------------------------------------------------------------
function evenex_src( $key, $default_value = '', $input_as_attachment = false ) { // for src
	if ( $input_as_attachment == true ) {
		$attachment = $key;
	} else {
		$attachment = evenex_option( $key );
	}

	if ( isset( $attachment[ 'url' ] ) && !empty( $attachment ) ) {
		return $attachment[ 'url' ];
	}

	return $default_value;
}


// return attachment alt in safe mode
// ----------------------------------------------------------------------------------------
function evenex_alt( $id ) {
	if ( !empty( $id ) ) {
		$alt = get_post_meta( $id, '_wp_attachment_image_alt', true );
		if ( !empty( $alt ) ) {
			$alt = $alt;
		} else {
			$alt = get_the_title( $id );
		}
		return $alt;
	}
}


// get original id in WPML enabled WP
// ----------------------------------------------------------------------------------------
function evenex_org_id( $id, $name = true ) {
	if ( function_exists( 'icl_object_id' ) ) {
		$id = icl_object_id( $id, 'page', true, 'en' );
	}

	if ( $name === true ) {
		$post = get_post( $id );
		return $post->post_name;
	} else {
		return $id;
	}
}


// converts rgb color code to hex format
// ----------------------------------------------------------------------------------------
function evenex_rgb2hex( $hex ) {
	$hex		 = preg_replace( "/^#(.*)$/", "$1", $hex );
	$rgb		 = array();
	$rgb[ 'r' ]	 = hexdec( substr( $hex, 0, 2 ) );
	$rgb[ 'g' ]	 = hexdec( substr( $hex, 2, 2 ) );
	$rgb[ 'b' ]	 = hexdec( substr( $hex, 4, 2 ) );

	$color_hex = $rgb[ "r" ] . ", " . $rgb[ "g" ] . ", " . $rgb[ "b" ];
	return $color_hex;
}


// WP kses allowed tags
// ----------------------------------------------------------------------------------------
function evenex_kses( $raw ) {

	$allowed_tags = array(
		'a'								 => array(
			'class'	 => array(),
			'href'	 => array(),
			'rel'	 => array(),
			'title'	 => array(),
		),
		'abbr'							 => array(
			'title' => array(),
		),
		'b'								 => array(),
		'blockquote'					 => array(
			'cite' => array(),
		),
		'cite'							 => array(
			'title' => array(),
		),
		'code'							 => array(),
		'del'							 => array(
			'datetime'	 => array(),
			'title'		 => array(),
		),
		'dd'							 => array(),
		'div'							 => array(
			'class'	 => array(),
			'title'	 => array(),
			'style'	 => array(),
		),
		'dl'							 => array(),
		'dt'							 => array(),
		'em'							 => array(),
		'h1'							 => array(),
		'h2'							 => array(),
		'h3'							 => array(),
		'h4'							 => array(),
		'h5'							 => array(),
		'h6'							 => array(),
		'i'								 => array(
			'class' => array(),
		),
		'img'							 => array(
			'alt'	 => array(),
			'class'	 => array(),
			'height' => array(),
			'src'	 => array(),
			'width'	 => array(),
		),
		'li'							 => array(
			'class' => array(),
		),
		'ol'							 => array(
			'class' => array(),
		),
		'p'								 => array(
			'class' => array(),
		),
		'q'								 => array(
			'cite'	 => array(),
			'title'	 => array(),
		),
		'span'							 => array(
			'class'	 => array(),
			'title'	 => array(),
			'style'	 => array(),
		),
		'iframe'						 => array(
			'width'			 => array(),
			'height'		 => array(),
			'scrolling'		 => array(),
			'frameborder'	 => array(),
			'allow'			 => array(),
			'src'			 => array(),
		),
		'strike'						 => array(),
		'br'							 => array(),
		'strong'						 => array(),
		'data-wow-duration'				 => array(),
		'data-wow-delay'				 => array(),
		'data-wallpaper-options'		 => array(),
		'data-stellar-background-ratio'	 => array(),
		'ul'							 => array(
			'class' => array(),
		),
	);

	if ( function_exists( 'wp_kses' ) ) { // WP is here
		$allowed = wp_kses( $raw, $allowed_tags );
	} else {
		$allowed = $raw;
	}


	return $allowed;
}


// build google font url
// ----------------------------------------------------------------------------------------
function evenex_google_fonts_url($font_families	 = []) {
	$fonts_url		 = '';
	/*
    Translators: If there are characters in your language that are not supported
    by chosen font(s), translate this to 'off'. Do not translate into your own language.
    */
	if ( $font_families && 'off' !== _x( 'on', 'Google font: on or off', 'evenex' ) ) {
		$query_args = array(
			'family' => urlencode( implode( '|', $font_families ) )
		);

		$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
	}

	return esc_url_raw( $fonts_url );
}


// return megamenu child item's slug
// ----------------------------------------------------------------------------------------
function evenex_get_mega_item_child_slug( $location, $option_id ) {
	$mega_item	 = '';
	$locations	 = get_nav_menu_locations();
	$menu		 = wp_get_nav_menu_object( $locations[ $location ] );
	$menuitems	 = wp_get_nav_menu_items( $menu->term_id );

	foreach ( $menuitems as $menuitem ) {

		$id			 = $menuitem->ID;
		$mega_item	 = dms_ext_mega_menu_get_db_item_option( $id, $option_id );
	}
	return $mega_item;
}


// return cover image from an youtube video url
// ----------------------------------------------------------------------------------------
function evenex_youtube_cover( $e ) {
	$src = null;
	//get the url
	if ( $e != '' ){
		$url = $e;
		$queryString = parse_url( $url, PHP_URL_QUERY );
		parse_str( $queryString, $params );
		$v = $params[ 'v' ];
		//generate the src
		if ( strlen( $v ) > 0 ) {
			$src = "http://i3.ytimg.com/vi/$v/default.jpg";
		}
	}

	return $src;
}


// return embed code for sound cloud
// ----------------------------------------------------------------------------------------
function evenex_soundcloud_embed( $url ) {
	return 'https://w.soundcloud.com/player/?url=' . urlencode($url) . '&auto_play=false&color=915f33&theme_color=00FF00';
}


// return embed code video url
// ----------------------------------------------------------------------------------------
function evenex_video_embed($url){
    //This is a general function for generating an embed link of an FB/Vimeo/Youtube Video.
	$embed_url = '';
    if(strpos($url, 'facebook.com/') !== false) {
        //it is FB video
        $embed_url ='https://www.facebook.com/plugins/video.php?href='.rawurlencode($url).'&show_text=1&width=200';
    }else if(strpos($url, 'vimeo.com/') !== false) {
        //it is Vimeo video
        $video_id = explode("vimeo.com/",$url)[1];
        if(strpos($video_id, '&') !== false){
            $video_id = explode("&",$video_id)[0];
        }
        $embed_url ='https://player.vimeo.com/video/'.$video_id;
    }else if(strpos($url, 'youtube.com/') !== false) {
        //it is Youtube video
        $video_id = explode("v=",$url)[1];
        if(strpos($video_id, '&') !== false){
            $video_id = explode("&",$video_id)[0];
        }
		$embed_url ='https://www.youtube.com/embed/'.$video_id;
    }else if(strpos($url, 'youtu.be/') !== false){
        //it is Youtube video
        $video_id = explode("youtu.be/",$url)[1];
        if(strpos($video_id, '&') !== false){
            $video_id = explode("&",$video_id)[0];
        }
        $embed_url ='https://www.youtube.com/embed/'.$video_id;
    }else{
        //for new valid video URL
    }
    return $embed_url;
}

if ( !function_exists( 'evenex_advanced_font_styles' ) ) :

	/**
	 * Get shortcode advanced Font styles
	 *
	 */
	function evenex_advanced_font_styles( $data ) {

		$style = [];

		if (is_string($data)) {
			$style = json_decode($data, true);
		} else {
			$style = $data;
		}

		$font_styles = $font_weight = '';

		$font_weight = (isset( $style[ 'weight' ] ) && $style[ 'weight' ]) ? 'font-weight:' . esc_attr( $style[ 'weight' ] ) . ';' : '';

		$font_styles .= isset( $style[ 'family' ] ) ? 'font-family: ' . $style[ 'family' ] . ', sans-serif;' : '';
		$font_styles .= isset($style[ 'style' ] ) && $style[ 'style' ] ? 'font-style:' . esc_attr( $style[ 'style' ] ) . ';' : '';

		$font_styles .= isset( $style[ 'color' ] ) && !empty( $style[ 'color' ] ) ? 'color:' . esc_attr( $style[ 'color' ] ) . ';' : '';
		$font_styles .= isset( $style[ 'line_height' ] ) && !empty( $style[ 'line_height' ] ) ? 'line-height:' . esc_attr( $style[ 'line_height' ] / $style[ 'size' ] ) . ';' : '';
		$font_styles .= isset( $style[ 'letter_spacing' ] ) && !empty( $style[ 'letter_spacing' ] ) ? 'letter-spacing:' . esc_attr( $style[ 'letter_spacing' ] / 1000 * 1 ) . 'rem;' : '';
		$font_styles .= isset( $style[ 'size' ] ) && !empty( $style[ 'size' ] ) ? 'font-size:' . esc_attr( $style[ 'size' ] ) . 'px;' : '';

		$font_styles .= !empty( $font_weight ) ? $font_weight : '';

		return !empty( $font_styles ) ? $font_styles : '';
	}

endif;

//  WPML CUSTOM Swicther

//WPML CUSTOM Swicther
if ( !function_exists( 'evenex_languages_list_popup' ) ) :

	function evenex_languages_list_popup() {
		$languages = icl_get_languages( 'skip_missing=0&orderby=code' );
		if ( !empty( $languages ) ) {
			echo '<div class="language-content"><ul class="flag-lists">';
			foreach ( $languages as $l ) {
				echo '<li>';
				if ( $l[ 'country_flag_url' ] ) {
					if ( !$l[ 'active' ] )
						echo '<a href="' . $l[ 'url' ] . '">';
					echo '<img src="' . $l[ 'country_flag_url' ] . '" height="12" alt="' . $l[ 'language_code' ] . '" width="18" />';
					if ( !$l[ 'active' ] )
						echo '</a>';
				}
				if ( !$l[ 'active' ] )
					echo '<a href="' . $l[ 'url' ] . '">';
				echo icl_disp_language( $l[ 'native_name' ], $l[ 'translated_name' ] );
				if ( !$l[ 'active' ] )
					echo '</a>';
				echo '</li>';
			}
			echo '</ul></div>';
		}
	}


endif;

// language list

if ( !function_exists( 'evenex_languages_list_wpml' ) ) :

	function evenex_languages_list_wpml() {
		$languages = icl_get_languages( 'skip_missing=0&orderby=code' );
		if ( !empty( $languages ) ) {
			echo '<ul class="language_switch_two">';
			foreach ( $languages as $l ) {
				echo '<li>';
				if ( !$l[ 'active' ] )
					echo '<a href="' . $l[ 'url' ] . '">';
				echo icl_disp_language( $l[ 'native_name' ], $l[ 'translated_name' ] );
				if ( !$l[ 'active' ] )
					echo '</a>';
				echo '</li>';
			}
			echo '</ul>';
		}
	}


endif;


function evenex_ekit_headers($format='html'){

    if (class_exists('ElementsKit_Lite') || in_array('elementskit/elementskit.php', apply_filters('active_plugins', get_option('active_plugins')))) {
        $select = [];
        $args = array(
            'posts_per_page'   => -1,
            'post_type' => 'elementskit_template',
            'meta_key' => 'elementskit_template_type',
            'meta_value' => 'header'
        );
		$headers = get_posts($args);
		$select[] = esc_html__( "Please select header", "evenex" );
        foreach($headers as $header) {
            $select[$header->ID ] = $header->post_title;
        }
        return $select;

    }
    return [];
}

function evenex_ekit_footers($format='html'){

    if (class_exists('ElementsKit_Lite') || in_array('elementskit/elementskit.php', apply_filters('active_plugins', get_option('active_plugins')))) {
        $select = [];
        $args = array(
            'posts_per_page'   => -1,
            'post_type' => 'elementskit_template',
            'meta_key' => 'elementskit_template_type',
            'meta_value' => 'footer'
        );
		$footers = get_posts($args);
		$select[] = esc_html__( "Please select footer", "evenex" );
        foreach($footers as $footer) {
            $select[$footer->ID ] = $footer->post_title;
        }
        return $select;

    }
    return [];
}

function xs_grid_line_parallax_animation( $classes ) {

	$on_parallax  =  evenex_option('xs_grid_line_parallax_animation');
	if(is_front_page()) {
		if($on_parallax){
			$classes[] .= 'xs-grid-line-parallax-animation';
		}
	}
	return $classes;
}

add_filter('body_class', 'xs_grid_line_parallax_animation');

function evenex_wp_body_classes( $classes ) {
    $classes[] = 'check';

    return $classes;
}
add_filter( 'body_class','evenex_wp_body_classes' );



// get event thumb
if (!function_exists('get_event_thumb')) {
	function get_event_thumb($post_id, $show_body_thumb_meta_info = "yes", $etn_event_posts_thumb_meta_select = "") {
		$etn_event_location = get_post_meta($post_id, 'etn_event_location', true);
		$category           = Helper::cate_with_link($post_id, 'etn_category', true);
		$get_cat            = get_the_terms($post_id, 'etn_category');
		$first_cat          = $get_cat[0];
		$category_link      = "";
		if ($first_cat !== null) {
			$category_link     = get_category_link( $first_cat->term_id );
		};
		$show_body_thumb_meta_info         = isset($show_body_thumb_meta_info) ? $show_body_thumb_meta_info: "yes";
		$etn_event_posts_thumb_meta_select = isset($etn_event_posts_thumb_meta_select) ? $etn_event_posts_thumb_meta_select            : "";
		?>
		<div class="etn-event-thumb">
			<a href="<?php echo esc_url(get_the_permalink($post_id)); ?>">
				<img src="<?php echo esc_url(get_the_post_thumbnail_url($post_id)); ?>" alt="<?php the_title_attribute($post_id); ?>">
			</a>
			<?php if ($show_body_thumb_meta_info == "yes") { ?>
				<div class="xs_etn_thumb_meta_wraper">
				<?php if (!empty($etn_event_posts_thumb_meta_select) && is_array($etn_event_posts_thumb_meta_select)) { ?>
					<?php foreach ($etn_event_posts_thumb_meta_select as $key => $value) { ?>
						<?php if ($value == "category") { ?>
							<?php if (!empty($category)) { ?>
							<a class="xs-event-term" href="<?php echo esc_url($category_link); ?>">
								<?php echo  Helper::kses($category); ?>
							</a>
							<?php } ?>
						<?php } ?>
						<?php if (isset($etn_event_location) && $etn_event_location != '' && $value == "location") { ?>
							<a class="xs-event-term" href="<?php echo esc_url($category_link); ?>">
								<?php echo esc_html( $etn_event_location ); ?>
							</a>
						<?php } ?>
					<?php } ?>
				<?php } else { ?>
					<?php if (!empty($category)) { ?>
					<a class="xs-event-term" href="<?php echo esc_url($category_link); ?>">
						<?php echo  Helper::kses($category); ?>
					</a>
					<?php }?>
				<?php } ?>
				</div>
			<?php } ?>
		</div>
		<?php
	}
}

// get event content
if (!function_exists('get_event_content')) {
	function get_event_content($post_id, $etn_title_limit = 12, $etn_show_desc = "yes", $post_content_limit = 20, $show_body_meta_info = "yes", $etn_event_posts_meta_select = "") {
		$etn_event_location = get_post_meta($post_id, 'etn_event_location', true);
		$etn_start_date     = get_post_meta($post_id, 'etn_start_date', true);
		$event_start_date   = !empty( $date_format ) ? date($date_options[$date_format], strtotime($etn_start_date)) : date('d/m/Y', strtotime($etn_start_date));

		$etn_event_posts_meta_select = isset($etn_event_posts_meta_select) ? $etn_event_posts_meta_select            : "";
		?>
		<div class="etn-event-content">
			<div class="xs-event-item-header">
				<?php
				if ($show_body_meta_info === "yes") {
					if (isset($etn_event_location) && $etn_event_location != '' || isset($event_start_date) && $event_start_date != '') { ?>
				<div class="xs-event-meta">
					<?php if (!empty($etn_event_posts_meta_select) && is_array($etn_event_posts_meta_select)) { ?>
					<?php foreach ($etn_event_posts_meta_select as $key => $value) { ?>
						<?php if (isset($event_start_date) && $event_start_date != '' && $value == "date") { ?>
						<span class="etn-event-date">
							<i class="far fa-calendar-alt"></i>
							<?php echo esc_html($event_start_date); ?>
						</span>
						<?php } ?>
						<?php if (isset($etn_event_location) && $etn_event_location != '' && $value == "location") { ?>
							<span class="etn-event-location"><i class="fas fa-map-marker-alt"></i> <?php echo esc_html($etn_event_location); ?></span>
						<?php } ?>
					<?php } ?>
					<?php } else {?>
						<?php if (isset($event_start_date) && $event_start_date != '') { ?>
						<span class="etn-event-date">
							<i class="far fa-calendar-alt"></i>
							<?php echo esc_html($event_start_date); ?>
						</span>
						<?php } ?>
						<?php if (isset($etn_event_location) && $etn_event_location != '') { ?>
							<span class="etn-event-location"><i class="fas fa-map-marker-alt"></i> <?php echo esc_html($etn_event_location); ?></span>
						<?php } ?>
					<?php } ?>
				</div>
				<?php } } ?>
				<h3 class="etn-title etn-event-title"><a href="<?php echo esc_url(get_the_permalink($post_id)); ?>"> <?php echo esc_html(Helper::trim_words(get_the_title($post_id), $etn_title_limit)); ?></a> </h3>
			</div>
			<?php if ($etn_show_desc === "yes") { ?>
			<p><?php echo esc_html(Helper::trim_words(get_the_content(  ), $post_content_limit)); ?></p>
			<?php }?>
		</div>
		<?php
	}
}

if (!function_exists('get_evenex_event_location')) {
	function get_evenex_event_location() {
		$location_args = [
			'post_type'      => ['etn'],
			'meta_query'     => [
				[
					'key'     => 'etn_event_location',
					'compare' => 'EXISTS',
				]
			],
		];
		$location_query_data = get_posts( $location_args );
		$location_data[]       = esc_html__( "Select Location", "evenex" );
		if (!empty($location_query_data)) {
			foreach ($location_query_data as $value) {
				$location_data[get_post_meta($value->ID, 'etn_event_location', true)] = get_post_meta($value->ID, 'etn_event_location', true);
			}
		}
		return $location_data;
	}
}

// Event advance search form
if (!function_exists('get_evenex_event_search_form')) {
	function get_evenex_event_search_form($etn_event_input_filed_title = "Find your next event", $etn_event_category_filed_title = "Event Category", $etn_event_location_filed_title = "Event Location", $etn_event_button_title = "Search Now", $etn_event_show_advacned_search = "yes") {

		$category_data = Helper::get_event_category();
		$location_data = [];
		if (function_exists('get_evenex_event_location')) {
			$location_data = get_evenex_event_location();
		}
		$date_order = [
			'today'        => esc_html__( ' Today ', 'evenex' ),
			'tomorrow'     => esc_html__( ' Tomorrow ', 'evenex' ),
			'yesterday'    => esc_html__( ' Yesterday ', 'evenex' ),
			'this-weekend' => esc_html__( ' This Weekend ', 'evenex' ),
			'this-week'    => esc_html__( ' This Week ', 'evenex' ),
			'this-month'   => esc_html__( ' This Month ', 'evenex' ),
			'upcoming'     => esc_html__( ' Upcoming ', 'evenex' ),
			'expired'      => esc_html__( ' Expired ', 'evenex' ),
		];
		$event_type_order = [
			'on'  => esc_html__( 'Online Event', 'evenex' ),
			'no' => esc_html__( 'Offline Event', 'evenex' ),
		];
		?>
		<form method="GET" action="<?php echo esc_url( home_url( '/' ) ); ?>" class="etn_evenex_inline_form">
			<div class="etn_evenex_inline_form_top">
				<div class="input-group">
					<div class="input-group-prepend">
						<span class="input-group-text">
							<!-- <i class="fas fa-search"></i> -->
							<img src="<?php echo get_template_directory_uri(); ?>/assets/images/search-icon/search_icon_01.svg"/>
						</span>
					</div>
					<input type="search" name="s" value="<?php echo get_search_query() ?>" placeholder="<?php echo esc_html__($etn_event_input_filed_title, 'evenex') ?>" class="form-control">
				</div>
				<!-- // Search input filed -->
				<div class="input-group">
					<div class="input-group-prepend">
						<span class="input-group-text">
						<!-- <i class="fab fa-buffer"></i> -->
						<img src="<?php echo get_template_directory_uri(); ?>/assets/images/search-icon/search_icon_02.svg"/>
						</span>
					</div>
					<select name="etn_event_location" class="etn_evenex_select2 etn_evenex_select">
						<option value><?php echo esc_html__( $etn_event_location_filed_title, "evenex" )?></option>
						<?php
						if (is_array($location_data) && !empty($location_data)) {
							$modify_array_data =  array_shift($location_data);
							foreach ($location_data as $value) {
								$select_value = "";
								if (isset($_GET['etn_event_location'])) {
									$select_value = $_GET['etn_event_location'];
								}
								?>
							<option <?php if (!empty($select_value) && $select_value === $value ) echo ' selected="selected"' ; ?> value="<?php echo esc_attr( $value ); ?>"><?php echo esc_html( $value ); ?></option>
								<?php
							}
						}
						?>
					</select>
				</div>
				<!-- // location -->
				<div class="input-group">
					<div class="input-group-prepend">
						<span class="input-group-text">
						<!-- <i class="fas fa-map-marker-alt"></i> -->
							<img src="<?php echo get_template_directory_uri(); ?>/assets/images/search-icon/search_icon_03.svg"/>
						</span>
					</div>
					<select name="etn_categorys" class="etn_evenex_select2 etn_evenex_select">
						<option value><?php echo esc_html__( $etn_event_category_filed_title, "evenex" )?></option>
						<?php
						if (!empty($category_data) && is_array($category_data)) {
							$select_cat_value;
							if (isset($_GET['etn_categorys'])) {
								$select_cat_value = $_GET['etn_categorys'];
							}
							foreach ($category_data as $key => $value) { ?>
								<option <?php if (!empty($select_cat_value) && $select_cat_value == $key ) echo ' selected="selected"' ; ?> value="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $value ); ?></option>
							<?php }
						}
						?>
					</select>
				</div>
				<!-- // cat -->
				<input type="hidden" name="post_type" value="etn" />
				<button type="submit" class="btn btn-primary"><?php echo esc_html__($etn_event_button_title, 'evenex') ?> </button>
			</div>
			<?php if ($etn_event_show_advacned_search === "yes") { ?>
			<div class="etn_evenex_inline_form_bottom">
				<h3 class="etn_event_form_title"><?php echo esc_html__( "Advanced Search", "evenex" ); ?></h3>
				<div class="row">
					<div class="col-lg-4 col-md-6">
						<p class="etn_evenex_inline_input_label"><?php echo esc_html__( "Sort by:", "evenex" )?></p>
						<select name="etn_event_date_range" class="etn_evenex_select2 etn_evenex_select">
							<option value><?php echo esc_html__( "Event Date", "evenex" )?></option>
							<?php
							if (!empty($date_order) && is_array($date_order)) {
								$select_date_value;
								if (isset($_GET['etn_event_date_range'])) {
									$select_date_value = $_GET['etn_event_date_range'];
								}
								foreach ($date_order as $key => $value) { ?>
									<option <?php if (!empty($select_date_value) && $select_date_value == $key ) echo ' selected="selected"' ; ?> value="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $value ); ?></option>
								<?php }
							}
							?>
						</select>
						<!-- // event date -->
					</div>
					<?php
					$settings = \Etn\Core\Settings\Settings::instance()->get_settings_option();
					if (isset($settings['etn_zoom_api']) && $settings['etn_zoom_api'] === "on") {
					?>
					<div class="col-lg-4 col-md-6">
						<p class="etn_evenex_inline_input_label"><?php echo esc_html__( "Event Type:", "evenex" )?></p>
						<select name="etn_event_will_happen" class="etn_evenex_select2 etn_evenex_select">
							<option value><?php echo esc_html__( "Event Type", "evenex" )?></option>
							<?php
							if (is_array($event_type_order) && !empty($event_type_order)) {
								foreach ($event_type_order as $key => $value) {
									$select_value = "";
									if (isset($_GET['etn_event_will_happen'])) {
										$select_value = $_GET['etn_event_will_happen'];
									}
									?>
								<option <?php if (!empty($select_value) && $select_value === $key ) echo ' selected="selected"' ; ?> value="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $value ); ?></option>
									<?php
								}
							}
							?>
						</select>
					</div>
					<?php } ?>
					<div class="col-lg-4 col-md-6">
						<p class="etn_evenex_inline_input_label"><?php echo esc_html__( "Preview Type:", "evenex" )?></p>
						<ul class="preview_type_lists list-unstyled">
							<li data-class="card_preview_style_one">
								<img src="<?php echo esc_attr( EVENEX_THEME_URI . '/assets/images/preview_style_one.svg' ); ?>" alt="style one">
							</li>
							<li data-class="card_preview_style_three">
								<img src="<?php echo esc_attr( EVENEX_THEME_URI . '/assets/images/preview_style_three.svg' ); ?>" alt="style three">
							</li>
						</ul>
					</div>
				</div>
			</div>
			<?php } ?>
		</form>
		<?php
	}
}

// get vent data
if (!function_exists('get_evenex_eventin_data')) {
	function get_evenex_eventin_data($posts_per_page = -1) {
		$etn_event_location = "";
		if (isset($_GET['etn_event_location'])) {
			$etn_event_location = $_GET['etn_event_location'];
		}
		$event_cat = "";
		if (isset($_GET['etn_categorys'])) {
			$event_cat          = $_GET['etn_categorys'];
		}

		$keyword = "";
		if (isset($_GET['s'])) {
			$keyword = $_GET['s'];
		}

		$data_query_args = [
			'post_type'      => 'etn',
			'post_status'    => 'publish',
			's'              => $keyword,
			'posts_per_page' => isset($posts_per_page) ? $posts_per_page : -1
		];
		if (!empty($event_cat)) {
			$data_query_args['tax_query'] = [
				[
					'taxonomy'         => 'etn_category',
					'terms'            => [$event_cat],
					'field'            => 'id',
					'include_children' => true,
					'operator'         => 'IN',
				]
			];
		}
		if (!empty($etn_event_location)) {
			$data_query_args['meta_query'] = [
				[
					'key'     => 'etn_event_location',
					'value'   => $etn_event_location,
					'compare' => 'LIKE',
				]
			];
		}
		$query_data = get_posts( $data_query_args );
		return $query_data;
	}
}

// event search filter
if (!function_exists('event_etn_search_filter')) {
	function event_etn_search_filter($query) {
		if ((isset($_GET['post_type']) && $_GET['post_type'] === "etn") && $query->is_search && !is_admin()) {
			$prev_date = date('Y-m-d', strtotime(date( 'Y-m-d' ) .' -1 day'));
			$next_date = date('Y-m-d', strtotime(date( 'Y-m-d' ) .' +1 day'));


			$week_date = date('Y-m-d', strtotime(date( 'Y-m-d' ) .' +7 day'));

			$week_start = strtotime("last monday");
			$week_start = date('w', $week_start)==date('w') ? $week_start+7*86400 : $week_start;
			$weekend = date('Y-m-d', strtotime(date("Y-m-d",$week_start)." +6 days"));

			$month_start_date = date('Y-m-d', strtotime(date( 'Y-m' )));
			$month_end_date = date('Y-m-d', strtotime(date("Y-m-t", strtotime($month_start_date))));

			$etn_event_location = "";
			if (isset($_GET['etn_event_location'])) {
				$etn_event_location = $_GET['etn_event_location'];
			}
			$etn_event_date_range = "";
			if (isset($_GET['etn_event_date_range'])) {
				$etn_event_date_range = $_GET['etn_event_date_range'];
			}
			$event_cat  = "";
			if (isset($_GET['etn_categorys'])) {
				$event_cat = $_GET['etn_categorys'];
			}
			$etn_event_will_happen  = "";
			if (isset($_GET['etn_event_will_happen'])) {
				$etn_event_will_happen = $_GET['etn_event_will_happen'];
			}
			$keyword = "";
			if (isset($_GET['s'])) {
				$keyword = $_GET['s'];
			}
			$meta_location_query = [];
			if (!empty($etn_event_location)) {
				$meta_location_query = [
					[
						'key'     => 'etn_event_location',
						'value'   => $etn_event_location,
						'compare' => "EXSISTS",
					],
				];
			}
			$meta_date_query = [];
			if (!empty($etn_event_date_range)) {
				if ($etn_event_date_range === "today") {
					$meta_date_query = [
						'relation' => 'AND',
						[
							'key'     => 'etn_end_date',
							'value'   => date( 'Y-m-d' ),
							'compare' => '>=',
						],
						[
							'key'     => 'etn_start_date',
							'value'   => date( 'Y-m-d' ),
							'compare' => '<=',
						],
					];
				} elseif ($etn_event_date_range === "tomorrow") {
					$meta_date_query = [
						'relation' => 'AND',
						[
							'key'     => 'etn_end_date',
							'value'   => $next_date,
							'compare' => '>=',
						],
						[
							'key'     => 'etn_start_date',
							'value'   => $next_date,
							'compare' => '<=',
						],
					];
				} elseif ($etn_event_date_range === "yesterday") {
					$meta_date_query = [
						'relation' => 'AND',
						[
							'key'     => 'etn_end_date',
							'value'   => $prev_date,
							'compare' => '>=',
						],
						[
							'key'     => 'etn_start_date',
							'value'   => $prev_date,
							'compare' => '<=',
						],
					];
				} elseif ($etn_event_date_range === "this-weekend") {
					$meta_date_query = [
						'relation' => 'AND',
						[
							'key'     => 'etn_end_date',
							'value'   => $weekend,
							'compare' => '>=',
						],
						[
							'key'     => 'etn_start_date',
							'value'   => $weekend,
							'compare' => '<=',
						],
					];
				} elseif ($etn_event_date_range === "this-week") {
					$meta_date_query = [
						'relation' => 'OR',
						[
							'key'     => 'etn_start_date',
							'value'   => array($week_start,$weekend),
							'type'    => 'date',
							'compare' => 'BETWEEN'
						],
						[
							'key'     => 'etn_end_date',
							'value'   => array($week_start,$weekend),
							'type'    => 'date',
							'compare' => 'BETWEEN'
						],
					];
				} elseif ($etn_event_date_range === "this-month") {
					$meta_date_query = [
						'relation' => 'OR',
						[
							'key'     => 'etn_start_date',
							'value'   => array($month_start_date,$month_end_date),
							'type'    => 'date',
							'compare' => 'BETWEEN'
						],
						[
							'key'     => 'etn_end_date',
							'value'   => array($month_start_date,$month_end_date),
							'type'    => 'date',
							'compare' => 'BETWEEN'
						],
					];
				} elseif ($etn_event_date_range === "upcoming") {
					$meta_date_query = [
						'relation' => 'OR',
						[
							'key'     => 'etn_end_date',
							'value'   => date( 'Y-m-d' ),
							'compare' => '>',
						],
						[
							'key'     => 'etn_end_date',
							'value'   => '',
							'compare' => '=',
						],
					];
				} elseif ($etn_event_date_range === "expired") {
					$meta_date_query = [
						'relation' => 'OR',
						[
							'key'     => 'etn_end_date',
							'value'   => date( 'Y-m-d' ),
							'compare' => '<',
						],
						[
							'key'     => 'etn_end_date',
							'value'   => '',
							'compare' => '=',
						],
					];
				}
			}
			$meta_event_happen_query = [];
			if (!empty($etn_event_will_happen)) {
				$meta_event_happen_query = [
					[
						'key'     => 'etn_zoom_event',
						'value'   => $etn_event_will_happen,
						'compare' => "EXSISTS",
					],
				];
			}
			$meta_query = [
				'relation' => 'AND',
				[
					$meta_location_query,
					$meta_date_query,
					$meta_event_happen_query
				]
			];
			$query->set('meta_query', $meta_query);
			if (!empty($keyword)) {
				$query->set('s', $keyword);
			}
			if (!empty($event_cat)) {
				$taxquery = [
					[
						'taxonomy' => 'etn_category',
						'terms'    => [$event_cat],
						'field'    => 'id',
					]
				];
				$query->set( 'tax_query', $taxquery );
			}
			$query->set('post_type', array('etn'));
		}
		return $query;
	}
	add_filter('pre_get_posts', 'event_etn_search_filter', 9999);
}

if(!function_exists('get_event_ajax_item')){
	function get_event_ajax_item($id){
		if ( defined( 'DEVM' ) ) {
			$etn_event_col = evenex_option('eventin_search__column',4);
		} else {
			$etn_event_col = 4;
		}

		ob_start();
		?>
		<div class="<?php echo esc_attr( "etn-col-md-6 etn-col-lg-$etn_event_col" )?>">
			<div class="etn-event-item">
				<!-- thumbnail -->
				<?php if (get_the_post_thumbnail_url($id)) { ?>
					<!-- $post_id, $show_body_thumb_meta_info $etn_event_posts_thumb_meta_select -->
					<?php get_event_thumb($id); ?>
				<?php } ?>
				<!-- thumbnail start-->

				<!-- content start-->
				<!-- $post_id, $etn_title_limit $etn_show_desc, $post_content_limit, $show_body_meta_info, $etn_event_posts_meta_select -->
				<?php get_event_content($id); ?>
				<!-- content end-->
			</div>
			<!-- etn event item end-->
		</div>

		<?php return ob_get_clean();
	}
}

if (!function_exists('xs_event_ajax_get_data')) {
	function xs_event_ajax_get_data() {
		$prev_date = date('Y-m-d', strtotime(date( 'Y-m-d' ) .' -1 day'));
		$next_date = date('Y-m-d', strtotime(date( 'Y-m-d' ) .' +1 day'));


		$week_date = date('Y-m-d', strtotime(date( 'Y-m-d' ) .' +7 day'));

		$week_start = strtotime("last monday");
		$week_start = date('w', $week_start)==date('w') ? $week_start+7*86400 : $week_start;
		$weekend = date('Y-m-d', strtotime(date("Y-m-d",$week_start)." +6 days"));

		$month_start_date = date('Y-m-d', strtotime(date( 'Y-m' )));
		$month_end_date = date('Y-m-d', strtotime(date("Y-m-t", strtotime($month_start_date))));

		$keyword  = "";
		if (isset($_POST['s'])) {
			$keyword = $_POST['s'];
		}
		$event_cat  = "";
		if (isset($_POST['etn_categorys'])) {
			$event_cat = $_POST['etn_categorys'];
		}
		$etn_event_location    = "";
		if (isset($_POST['etn_event_location'])) {
			$etn_event_location   = $_POST['etn_event_location'];
		}
		$etn_event_date_range  = "";
		if (isset($_POST['etn_event_date_range'])) {
			$etn_event_date_range = $_POST['etn_event_date_range'];
		}
		$etn_event_will_happen  = "";
		if (isset($_POST['etn_event_will_happen'])) {
			$etn_event_will_happen = $_POST['etn_event_will_happen'];
		}
		if (isset($_POST['etn_event_location']) || isset($_POST['etn_categorys']) || isset($_POST['s']) || isset($_POST['etn_event_date_range']) || isset($_POST['etn_event_will_happen'])) {
			$query_string = [
				'post_type'      => 'etn',
				'post_status'    => 'publish'
			];


			if (isset($_POST['type'])) {
				$id = $_POST['id'];
				$query_string['post__not_in'] = explode(',', $id);
			}

			if (!empty($keyword)) {
				$query_string['s'] = $keyword;
			}
			if (!empty($event_cat)) {
				$query_string['tax_query'] = [
					[
						'taxonomy'         => 'etn_category',
						'terms'            => [$event_cat],
						'field'            => 'id',
					]
				];
			}
			$meta_location_query_string = [];
			if (!empty($etn_event_location)) {
				$meta_location_query_string = [
					'key'     => 'etn_event_location',
					'value'   => $etn_event_location,
					'compare' => 'EXSISTS',
				];
			}
			$meta_event_happen_query = [];
			if (!empty($etn_event_will_happen)) {
				$meta_event_happen_query = [
					'key'     => 'etn_zoom_event',
					'value'   => $etn_event_will_happen,
					'compare' => 'LIKE',
				];
			}
			$meta_event_date_query_string = [];
			if (!empty($etn_event_date_range)) {
				if ($etn_event_date_range === "today") {
					$meta_event_date_query_string = [
						'relation' => 'AND',
						[
							'key'     => 'etn_end_date',
							'value'   => date( 'Y-m-d' ),
							'compare' => '>=',
						],
						[
							'key'     => 'etn_start_date',
							'value'   => date( 'Y-m-d' ),
							'compare' => '<=',
						],
					];
				} elseif ($etn_event_date_range === "tomorrow") {
					$meta_event_date_query_string = [
						'relation' => 'AND',
						[
							'key'     => 'etn_end_date',
							'value'   => $next_date,
							'compare' => '>=',
						],
						[
							'key'     => 'etn_start_date',
							'value'   => $next_date,
							'compare' => '<=',
						],
					];
				} elseif ($etn_event_date_range === "yesterday") {
					$meta_event_date_query_string = [
						'relation' => 'AND',
						[
							'key'     => 'etn_end_date',
							'value'   => $prev_date,
							'compare' => '>=',
						],
						[
							'key'     => 'etn_start_date',
							'value'   => $prev_date,
							'compare' => '<=',
						],
					];
				} elseif ($etn_event_date_range === "this-weekend") {
					$meta_event_date_query_string = [
						'relation' => 'AND',
						[
							'key'     => 'etn_end_date',
							'value'   => $weekend,
							'compare' => '>=',
						],
						[
							'key'     => 'etn_start_date',
							'value'   => $weekend,
							'compare' => '<=',
						],
					];
				} elseif ($etn_event_date_range === "this-week") {
					$meta_event_date_query_string = [
						'relation' => 'OR',
						[
							'key'     => 'etn_start_date',
							'value'   => array($week_start,$weekend),
							'type'    => 'date',
							'compare' => 'BETWEEN'
						],
						[
							'key'     => 'etn_end_date',
							'value'   => array($week_start,$weekend),
							'type'    => 'date',
							'compare' => 'BETWEEN'
						],
					];
				} elseif ($etn_event_date_range === "this-month") {
					$meta_event_date_query_string = [
						'relation' => 'OR',
						[
							'key'     => 'etn_start_date',
							'value'   => array($month_start_date,$month_end_date),
							'type'    => 'date',
							'compare' => 'BETWEEN'
						],
						[
							'key'     => 'etn_end_date',
							'value'   => array($month_start_date,$month_end_date),
							'type'    => 'date',
							'compare' => 'BETWEEN'
						],
					];
				} elseif ($etn_event_date_range === "upcoming") {
					$meta_event_date_query_string = [
						'relation' => 'OR',
						[
							'key'     => 'etn_end_date',
							'value'   => date( 'Y-m-d' ),
							'compare' => '>',
						],
						[
							'key'     => 'etn_end_date',
							'value'   => '',
							'compare' => '=',
						],
					];
				} elseif ($etn_event_date_range === "expired") {
					$meta_event_date_query_string = [
						'relation' => 'OR',
						[
							'key'     => 'etn_end_date',
							'value'   => date( 'Y-m-d' ),
							'compare' => '<',
						],
						[
							'key'     => 'etn_end_date',
							'value'   => '',
							'compare' => '=',
						],
					];
				}
			}
			$query_string['meta_query'] = [
				'relation' => 'AND',
				[
					$meta_location_query_string,
					$meta_event_date_query_string,
					$meta_event_happen_query
				]
			];
			$search = new WP_Query( $query_string );
			$newdata = '';
			$ids = [];

			if($search->have_posts()) {
				while($search->have_posts()) {
					$search->the_post();
					$ids[] = get_the_id();
					$newdata .= get_event_ajax_item(get_the_id());
				}
			} wp_reset_postdata();
			echo json_encode( $post_data = [ "data" => $newdata, "posts_ids" => $ids] );
		}

		wp_die();
	}
	add_action( 'wp_ajax_xs_event_ajax_get_data', 'xs_event_ajax_get_data' );
	add_action( 'wp_ajax_nopriv_xs_event_ajax_get_data', 'xs_event_ajax_get_data' );
}

if (!function_exists('evnex_darklight_mode')) {
	function evnex_darklight_mode(){
		$style_darklight_mode = evenex_option('enable_dark_and_light_mode');
		if($style_darklight_mode == 'yes'){
		?>
			<div class="color_swicher change-mode">
				<div class="switch_container">
					<i class="switch_light_icon fas fa-sun"></i>
					<i class="switch_dark_icon fas fa-moon"></i>
				</div>
			</div>
		<?php
		}
	}
	add_action('wp_head', 'evnex_darklight_mode');
}

if (!function_exists('evenex_excerpt_length')) {
	function evenex_excerpt_length( $length ) {
		if((function_exists('is_post_type_archive') && is_post_type_archive('etn')) || is_tax( 'etn_category' )	){
			return 10;
		}
		return $length;
	}
	add_filter( 'excerpt_length', 'evenex_excerpt_length', 999 );
}
if (class_exists('\Etn\Bootstrap')) {
	add_action('etn_after_event_archive_thumbnail', function(){
		$cats = get_the_terms(get_the_id(), 'etn_category');
		if(!empty($cats) && !empty($cats[0])) : ?>
			<a href="<?php echo esc_url(get_term_link($cats[0]->term_id)) ?>" class="xs-event-term"><?php echo esc_html($cats[0]->name); ?></a>
		<?php endif; ?>

		<a href="#" class="xs-event-wishlist"><i class="far fa-heart"></i></a>
		<?php
	});

	add_action('etn_before_event_archive_title', function(){
		$etn_event_location = get_post_meta(get_the_ID(), 'etn_event_location', true);
		$etn_start_date     = get_post_meta(get_the_ID(), 'etn_start_date', true);
		$event_start_date   = isset($event_options["date_format"]) && $event_options["date_format"] !== '' ? date($date_options[$event_options["date_format"]], strtotime($etn_start_date)) : date('d/m/Y', strtotime($etn_start_date));
		?>
			<div class="xs-event-item-header">
				<div class="xs-event-meta">
					<div class="etn-event-date">
						<i class="far fa-calendar-alt"></i>
						<?php echo  esc_html($event_start_date); ?>
					</div>
					<div class="etn-event-location"><i class="fas fa-map-marker-alt"></i> <?php echo esc_html($etn_event_location); ?></div>
				</div>
				<h3 class="etn-title etn-event-title"><a href="<?php echo esc_url(get_the_permalink()) ?>"><?php echo esc_html(get_the_title()); ?></a> </h3>
			</div>
		<?php
	});

	add_filter( 'body_class', function($classes){
		if ((function_exists('is_post_type_archive') && is_post_type_archive('etn-speaker')) || is_tax('etn-speaker')) {
			return array_merge( $classes, array( 'xs-event-single-speaker evenex_etn_speaker_archive' ) );
		}

		if((function_exists('is_post_type_archive') && is_post_type_archive('etn')) || is_tax('etn_category')){
			return array_merge( $classes, array( 'xs-event-archive-wrap' ) );
		} else if(function_exists('is_singular') && is_singular('etn')){
			return array_merge( $classes, array( 'xs-event-single-wrap' ) );
		}

		return $classes;
	});
}

// single page
if (!function_exists('xs_event_section_heading')) {
	function xs_event_section_heading($title, $sub_title){
		if(!empty($title)) : ?>
			<h2 class="xs-event-single-title"><?php echo esc_html($title); ?></h2>
		<?php endif; ?>

		<?php if(!empty($sub_title)) : ?>
			<p class="xs-event-single-subtitle"><?php echo esc_html($sub_title); ?></p>
		<?php endif;
	}
}

if (class_exists('\Etn\Bootstrap')) {
	if (!function_exists('evenex_banner')) {
		function evenex_banner(){
			get_template_part( 'template-parts/banner/content', 'banner-eventin-single' );
		}
		add_action('etn_before_single_event_details', 'evenex_banner');
		add_action('etn_before_archive_container', 'evenex_banner');
	}
	if (!function_exists('etn_archive_enenex_blog_banner')) {
		function etn_archive_enenex_blog_banner() {
			get_template_part( 'template-parts/banner/content-banner', 'blog' );
		}
		add_action('etn_before_event_archive_container', 'etn_archive_enenex_blog_banner');
		add_action('etn_before_speaker_archive_container', 'etn_archive_enenex_blog_banner');
		add_action('etn_speaker_content_before', 'etn_archive_enenex_blog_banner', 8);
	}
	add_action('etn_before_single_event_container', function($id){
		?>
			<div class="xs-event-single-main-header">
				<div class="row align-items-center">
					<div class="col-md-6 col-xs-12">
						<?php if (has_post_thumbnail()) : ?>
							<div class="etn-single-event-media">
								<div class="etn-single-event-img" style="background-image: url(<?php echo esc_url(get_the_post_thumbnail_url()); ?>)"></div>

								<?php
									 $cats = get_the_terms($id, 'etn_category');
									 if(!empty($cats) && !empty($cats[0])) : ?>
										 <a href="<?php echo esc_url(get_term_link($cats[0]->term_id)) ?>" class="xs-event-term"><?php echo esc_html($cats[0]->name); ?></a>
									 <?php endif;
								?>
							</div>
						<?php endif; ?>
					</div>
					<div class="col-md-6 col-xs-12 align-self-center">
						<?php
						$etn_event_location = get_post_meta($id, 'etn_event_location', true);
						$etn_start_date     = get_post_meta($id, 'etn_start_date', true);
						$event_start_date   = isset($event_options["date_format"]) && $event_options["date_format"] !== '' ? date($date_options[$event_options["date_format"]], strtotime($etn_start_date)) : date('d/m/Y', strtotime($etn_start_date));
						?>
						<div class="xs-event-meta">
							<div class="etn-event-date">
								<img class="etn_meta_info_icon" src="<?php echo esc_url( EVENEX_IMG . "/calendar_icon.svg" ); ?>" alt="start date">
								<?php echo  esc_html($event_start_date); ?>
							</div>
							<div class="etn-event-location">
								<img class="etn_meta_info_icon" src="<?php echo esc_url( EVENEX_IMG . "/map_icon.svg" ); ?>" alt="map icon">
								<?php echo esc_html($etn_event_location); ?>
							</div>
						</div>
						<h2 class="etn-event-entry-title"> <?php echo esc_html(get_the_title($id)); ?> </h2>
					</div>
				</div>
				<div id='xs-pricing'></div>
			</div>
		<?php
	});

	add_filter('etn_event_cart_button_text', function(){
		return esc_html__("Purchase Ticket", "evenex");
	});


	add_action('etn_after_single_event_content_body', function($id){
		$speaker_title = get_post_meta($id, 'xs_single_speaker_section_title', true);
		$speaker_sub_title = get_post_meta($id, 'xs_single_speaker_section_sub_title', true);
		?>
			<!-- Speaker -->
			<div class="xs-event-single-speaker xs-event-single-padding">

				<?php xs_event_section_heading($speaker_title, $speaker_sub_title); ?>

				<?php echo do_shortcode('[speakers limit="6]'); ?>

				<div class="xs-event-btn-inner">
					<a href="<?php echo get_post_type_archive_link('etn-speaker') ?>" class="btn btn-primary"><?php esc_html_e('View All Speakers', 'evenex'); ?></a>
				</div>
			</div>
			<!-- end speaker -->

			<!-- Schedule -->
			<?php get_template_part('template-parts/eventin/single-schedule'); ?>
			<!-- ./End Schedule -->

			<!-- Venue Direction -->
			<?php
			$event_location = get_post_meta($id, 'etn_event_location', true);
			$venue_title = get_post_meta($id, 'xs-event-venue-title', true);
			$venue_sub_title = get_post_meta($id, 'xs-event-venue-sub-title', true);
			if(!empty($event_location)) :
			?>
				<div class="xs-event-single-venue xs-event-single-padding">
					<?php xs_event_section_heading($venue_title, $venue_sub_title); ?>
					<div class="xs-event-faq-venue-iframe">
						<iframe width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.it/maps?q=<?php echo esc_attr($event_location); ?>; ?>&output=embed"></iframe>
					</div>
				</div>
			<?php endif; ?>
			<!-- ./End Venue Direction -->

			<!-- 360 Live Tour -->
			<?php
			$live_title = get_field('xs-360-section-title', $id);
			$live_sub_title = get_field('xs-360-section-sub-title', $id);
			$live_iframe_url = get_field('xs-360-live-tour-url', $id);
			?>
				<div class="xs-event-single-360-live xs-event-single-padding">
					<?php xs_event_section_heading($live_title, $live_sub_title); ?>

					<?php if(!empty($live_iframe_url)) : ?>
						<div class="xs-event-360-live-iframe">
							<iframe src="<?php echo esc_url($live_iframe_url); ?>" width="600" height="450"></iframe>
						</div>
					<?php endif; ?>
				</div>

			<!-- ./End 360 Live Tour -->

			<!--  xs-gallery-section -->
			<?php
				$gallery = get_field('xs-single-event-gallery', $id);
				$gallery_title = get_post_meta($id, 'xs-event-gallery-title', true);
				$gallery_sub_title = get_post_meta($id, 'xs-event-gallery-sub-title', true);

			if(!empty($gallery)) :
			?>
				<div class="xs-gallery-section">
					<div class="xs-gallery-wrapper">
						<?php xs_event_section_heading($gallery_title, $gallery_sub_title); ?>
						<div class="row">
							<?php foreach($gallery as $gal) : ?>
								<div class="col-md-4 col-sm-6">
									<a class="xs-gallery" href="<?php echo esc_url($gal['url']); ?>">
										<img src=<?php echo esc_url($gal['url']); ?>>
										<span class="plus-icon bg-orange">
											<i class="fa fa-plus"></i>
										</span>
									</a>
								</div>
							<?php endforeach; ?>
						</div>
						<!-- <div class="xs-event-btn-inner">
							<a href="#" class="btn btn-primary"><?php esc_html_e('Load More Photos', 'evenex'); ?></a>
						</div> -->
					</div>
				</div>
			<?php endif; ?>
			<!-- end xs-gallery-section -->

			<!-- Faq -->
			<?php
				$faq_list = get_field('xs-single-event-faq', $id);
				$faq_sec_title = get_field('xs-event-faq-section-title', $id);
				$faq_sec_sub_title = get_field('xs-event-faq-section-sub-title', $id);
			if(!empty($faq_list)) :
			?>
				<div class="xs-event-single-faq xs-event-single-padding">
					<?php xs_event_section_heading($faq_sec_title, $faq_sec_sub_title); ?>


					<div class="xs-event-faq-list">
						<?php foreach($faq_list as $key => $faq) : ?>
							<div class="card xs-faq-item">
								<div class="card-header" id="xs-faq-heading-<?php echo esc_attr($key); ?>">
									<h5 class="mb-0">
										<button class="xs-event-acordion-heading <?php echo $key != 0 ? 'collapsed' : ''; ?>" data-toggle="collapse" data-target="#xs-faq-t-<?php echo esc_attr($key); ?>" aria-expanded="<?php echo $key == 0 ? 'true' : 'false'; ?>" aria-controls="xs-faq-t-<?php echo esc_attr($key); ?>">
											<?php echo esc_html($faq['heading']); ?>
											<i class="fa fa-plus"></i>
										</button>
									</h5>
								</div>

								<div id="xs-faq-t-<?php echo esc_attr($key); ?>" aria-labelledby="xs-faq-heading-<?php echo esc_attr($key); ?>" class="collapse <?php echo $key == 0 ? 'show' : ''; ?>">
									<div class="xs-event-faq-content">
									   <p><?php echo esc_html($faq['content']); ?></p>
									</div>
								</div>
							</div>
						<?php endforeach; ?>
					</div>
				</div>
			<?php endif; ?>
			<!-- End FAQ -->

			<!-- Tag -->
			<?php
				if(function_exists('etn_after_single_event_content_body_show_meta')){
					etn_after_single_event_content_body_show_meta($id);
				}
			?>
			<!-- ./End Tag -->

			<!-- social -->
			<div class="xs-event-single-social">
				<h4 class="etn-tags-title"><?php esc_html_e('Share on Social', 'evenex'); ?></h4>
				<?php if( function_exists('__wp_social_share_pro_check') ){
					if( __wp_social_share_pro_check() ){
					?>
					<div class="xs_eventin-social-share-wraper">
						<?php echo __wp_social_share( 'all', ['class' => 'xs_eventin-social-share'] ); ?>
					</div>
					<?php
					}
				}
				?>
			</div>
		<?php

	});


	remove_action( "etn_after_single_event_container", "etn_after_single_event_container_related_events", 10 );
	remove_action( "etn_after_single_event_content_body", "etn_after_single_event_content_body_show_meta", 10 );
	remove_action( "etn_single_event_meta", "etn_single_event_meta_details", 10 );

	// rename tag text
	add_filter('etn_event_tag_list_title', function(){
		return esc_html__('Event TAGs', "evenex");
	});

	add_action('etn_after_single_event_meta', function($id){
		$data   = \Etn\Utils\Helper::single_template_options( $id );

		$data_query_args = [
			'post_type'   => 'etn-speaker',
			'post_status' => 'publish',
		];
		if (!empty($data['etn_organizer_events']) && is_array($data['etn_organizer_events'])) {
			$data_query_args['tax_query'] = [
				'taxonomy'         => 'etn_category',
				'terms'            => [$data['etn_organizer_events']],
				'field'            => 'id',
				'include_children' => true,
				'operator'         => 'IN',
			];
		}
		$query_data = get_posts( $data_query_args );
		?>
			<div class="etn-event-meta-info etn-widget">
				<h4 class="xs-widget-title"><?php esc_html_e('Short Details', 'evenex'); ?></h4>
				<ul>
					<?php if(!empty($data['event_start_date'])) : ?>
						<li>
							<img class="etn_meta_info_icon" src="<?php echo esc_url( EVENEX_IMG . "/calendar_icon.svg" ); ?>" alt="start date">
							<span> <?php echo esc_html__('Start Date:', "eventin"); ?></span>
							<?php echo esc_html($data['event_start_date']); ?>
						</li>
					<?php endif; ?>

					<?php if(!empty($data['etn_event_location'])) : ?>
						<li>
							<img class="etn_meta_info_icon" src="<?php echo esc_url( EVENEX_IMG . "/map_icon.svg" ); ?>" alt="Event Venue">
							<span> <?php echo esc_html__('Event Venue:', "eventin"); ?></span>
							<?php echo esc_html($data['etn_event_location']); ?>
						</li>
					<?php endif; ?>

					<?php if (!empty($query_data) && is_array($query_data)) : ?>
						<li>
							<img class="etn_meta_info_icon" src="<?php echo esc_url( EVENEX_IMG . "/user_icon.svg" ); ?>" alt="Organizer">
							<span> <?php echo esc_html__('Organizer:', "eventin"); ?></span>
							<?php echo get_the_title( $query_data[0]->ID ); ?>
						</li>
					<?php endif; ?>

					<?php if(!empty($data['category'])) : ?>
						<li>
							<img class="etn_meta_info_icon" src="<?php echo esc_url( EVENEX_IMG . "/category_icon.svg" ); ?>" alt="Category">
							<span> <?php echo esc_html__('Category:', "eventin"); ?></span>
							<?php echo esc_html(strip_tags($data['category'])); ?>
						</li>
					<?php endif; ?>

					<?php if (!empty($query_data) && is_array($query_data)) { ?>
					<li>
						<img class="etn_meta_info_icon" src="<?php echo esc_url( EVENEX_IMG . "/envelope_icon.svg" ); ?>" alt="Email">
						<span> <?php echo esc_html__('Email:', "eventin"); ?></span>
						<a href="mailto:<?php echo esc_attr(get_post_meta( $query_data[0]->ID , 'etn_speaker_website_email', true)) ;?>"><?php echo esc_html(get_post_meta( $query_data[0]->ID , 'etn_speaker_website_email', true)) ;?></a>
					</li>
					<?php } ?>
					<?php if (!empty($query_data) && is_array($query_data)) { ?>
					<li>
						<img class="etn_meta_info_icon" src="<?php echo esc_url( EVENEX_IMG . "/user_icon.svg" ); ?>" alt="Designation">
						<span> <?php echo esc_html__('Designation:', "eventin"); ?></span>
						<?php echo esc_html(get_post_meta( $query_data[0]->ID , 'etn_speaker_designation', true)) ;?>
					</li>
					<?php } ?>
				</ul>
				<?php
				?>
			</div>

			<!-- socials -->
			<?php
				$etn_event_socials = $data['etn_event_socials'];

				if(!empty($etn_event_socials)) :
			?>
			<div class="xs-event-single-social etn-widget">
				<h4><?php esc_html_e('We’re in Social', 'evenex'); ?></h4>
				<div class="etn-social">
					<?php if (is_array($etn_event_socials)) : ?>
						<?php foreach ($etn_event_socials as $social) : ?>
							<?php $etn_social_class = 'etn-' . str_replace('fab fa-', '', $social['icon']); ?>
							<a href="<?php echo esc_url($social['etn_social_url']); ?>" target="_blank" class="<?php echo esc_attr($etn_social_class); ?>"> <i class="<?php echo esc_attr($social['icon']); ?>"></i> </a>
						<?php endforeach; ?>
					<?php endif; ?>
				</div>
			</div>
			<?php
			endif;

	});
}

Zerion Mini Shell 1.0