Viewing File: /home/cienp/public_html/inct-inovamed/wp-content/themes/inovamed/single-eventos.php


<?php get_header(); ?>
<?php include 'menu.php'; ?>
<section class=" wrapper">
	<div class="grid">
		<h1><?php echo the_title(); ?></h1>
		<div class="data">
			<?php 

				$today = date('Ymd');
				$date_string = get_field('data_de_fim');
				$date_string = str_replace('-', '', $date_string);
				
				if ($today < $date_string) {
				    $status = "vaiRolar";
				}else{
					$status = "jaRolou";
				}

				$inicio = strtotime( get_field( 'data_de_inicio' ) );
				$inicio = date( 'd', $inicio );

				$fim    =  strtotime( get_field( 'data_de_fim' ) );
				$fim    = date( 'd', $fim );
				
				$mesFim =  strtotime( get_field( 'data_de_fim' ) );
				$mesFim = date("m", $mesFim);

				$locale = 'pt_BR';
				$dateFormatter = new IntlDateFormatter(
				    $locale,
				    IntlDateFormatter::LONG, // date type
				    IntlDateFormatter::NONE  // time type
				);
				$dateFormatter->setPattern('LLLL'); // full month name with NO DECLENSION ;-)
				$mesFim = $dateFormatter->format(DateTime::createFromFormat('n', (string)$mesFim));
			?>
			<?php if (get_field('data_de_inicio') && get_field('data_de_fim')){ ?>
				<span class="data <?php echo $status; ?>"><b><?php echo $inicio; ?></b> a <b><?php echo $fim; ?></b> de <span><?php echo $mesFim; ?></span></span>
			<?php } ?>
				<?php if (!get_field('data_de_inicio') && get_field('data_de_fim')){ ?>
				<span class="data <?php echo $status; ?>"><b><?php echo $fim; ?></b> de <span><?php echo $mesFim; ?></span></span>
			<?php } ?>
		</div>
		<div class="conteudo">
			<?php echo the_content(); ?>
		</div>
	</div>
</section>

<?php get_footer();
Back to Directory File Manager