HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: /datos/www/www.colombia.co/public_html/wp-content/themes/colombia2016/events.php
<?php
	/**
	* Template Name: Events
	*/

	get_header();

	$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;

	while ( have_posts() ) : the_post();
	$subtitle = get_post_meta(get_the_ID(), 'subtitle', true);
?>

<script type="text/javascript">
    var URL_BASE = "<?php echo esc_url(home_url('/')); ?>";
    var URL_THEME = "<?php echo get_template_directory_uri(); ?>";
    var WPURL_AJAX = URL_BASE + "wp-admin/admin-ajax.php";
</script>
<main role="main" class="category-events-new">
	<div id="category-header">
		<div class="container_title">
			<div class="cat-header-container">
				<?php 
					if($subtitle){
				?>	
					<h1 class="cat-title"><?php echo "Calendario" ;?></h1>
				<?php
					}
					else{
				?>
					<h1 class="cat-title"><?php echo "Calendar" ;?></h1>
				<?php } ?>
				<!-- <div class="cat-description"><?php the_content(); ?></div> -->
			</div>
		</div>
	</div>
	<?php 
	$locale = get_locale();

	if($locale == "es_CO"){
		$meses = array(
			__('Ene','colombia'),
			__('Feb','colombia'),
			__('Mar','colombia'),
			__('Abr','colombia'),
			__('May','colombia'),
			__('Jun','colombia'),
			__('Jul','colombia'),
			__('Ago','colombia'),
			__('Sep','colombia'),
			__('Oct','colombia'),
			__('Nov','colombia'),
			__('Dic','colombia')
		);
		$titleEvents = "Eventos en Colombia";
		$descriptionEvents = "Queremos que no te pierdas ninguna de nuestras festividades. Porque aquí, en Colombia, celebramos la alegría de tantas formas como nuestra increíble diversidad humana y cultural nos lo permite. Por ello, y para que disfrutes de nuestro país y sus miles de experiencias y eventos, te invitamos a conocer nuestro calendario que destaca varias de las fechas y acontecimientos claves de nuestro panorama nacional";
	}
	else if($locale == "en_US"){
		$meses = array(
			__('Jan','colombia'),
			__('Feb','colombia'),
			__('Mar','colombia'),
			__('Apr','colombia'),
			__('May','colombia'),
			__('Jun','colombia'),
			__('Jul','colombia'),
			__('Aug','colombia'),
			__('Sep','colombia'),
			__('Oct','colombia'),
			__('Nov','colombia'),
			__('Dec','colombia')
		);
		$titleEvents = "Events in Colombia";
		$descriptionEvents = "We don’t want you to miss any of our festivities. Here, in Colombia, we celebrate joy in as many ways as our human and cultural diversity allows us to. Which is why we want to invite you to get familiar with our festive-calendar, where you will find all the key-dates and events that take place nation-wide, so you always find the right time to enjoy our country and the thousands of events and experiences it has to offer.";
	} 
	?>
	<div id="content-wrapper">
		<div class="containerInformationEvents">

			<div class="informationTitle ">
				<h3><?php echo $titleEvents; ?></h3>	
			</div>
			<div>
				<p>
					<?php echo $descriptionEvents; ?></p>
			</div>
		</div>
		<section id="events">
			<div id="events-filter" class="">
				<div class="close-year-filter year-value">
					<span></span>	
				</div>
				<div id="year-filter" >
					
					<?php 
						
						$year = Date('Y');
						$year_prev = $year - 1;
						$year_end = $year + 10; ?>
						<div class=""><span class="year-value" data-year="<?php echo $year_prev; ?>"><?php echo $year_prev; ?></span></div>
					
						<?php
						
						while ($year < $year_end) { 
					?>
						<div class=""><span class="year-value" data-year="<?php echo $year; ?>"><?php echo $year; ?></span></div>
					<?php
							$year++;
						}
					?>
						
				</div>
				<div id="month-filter" class="swiper-container">
					<div class="swiper-wrapper">
					<?php
						$lang = get_bloginfo( 'language' );
						setlocale( LC_TIME, $lang );
						$start = new DateTime('12 months ago');
						$start->modify('first day of this month'); 
						$end = new DateTime('1 month ago');
						$end->modify('last day of this month');
						$interval = new DateInterval('P1M');
						$period   = new DatePeriod($start, $interval, $end);

						foreach ($period as $dt) {
					        $monthNames[] = $meses[ $dt->format('n') - 1 ];
					        $monthNums[] = $dt->format('n');
					    }

					    $c = 0;
					    foreach ($monthNames as $name) {
					?>
						<div class="swiper-slide month"><span class="month-label" data-month="<?php echo $monthNums[ $c ]?>"><?php echo $name; ?></span></div>
					<?php
						$c++;
					    }
					?>
					</div>
					<div class="swiper-button-prev slick-prev slick-arrow"></div>
	    			<div class="swiper-button-next slick-next slick-arrow"></div>
				</div>
			</div>
			<div id="events-wrapper" class="events_container">			
			<?php 			
				$events = new WP_Query(
					array(
						'post_type' => 'tp_eventos',
						'posts_per_page' => '9',
						'post_status' => array('publish', 'future'),
						'paged' => $paged
					)
				);
				if($events->have_posts()) : while($events->have_posts()){
					$events->the_post();
			?>
				<article <?php post_class('event'); ?> class="post_event" id="post-<?php the_ID(); ?>" itemscope itemtype="http://schema.org/Event">
					<div class="event-info">
						<?php
							$image = get_field('image_pt_eventos');
						?>
						<div class="image_event" style ="background-image : url (<?php echo $image['sizes']['medium']; ?>)">

						</div>
					</div>
					<div class="date_map_event">
						
					</div>
				</article>
			<?php } endif; wp_reset_query(); ?>
			</div>
			<?php if($events->max_num_pages > 1){ ?>
				<!-- <div id="pagination">
					<button id="load-more-events" class="btn-secondary" type="button" data-current-page="<?php echo $paged; ?>" data-total-pages="<?php echo $events->max_num_pages; ?>"><?php _e('Cargar más', 'colombia'); ?></button>
				</div> -->
			<?php } ?>
		</section>
		<?php //get_sidebar(); ?>
	</div>
</main>

<?php endwhile; ?>
<?php get_footer(); ?>