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

<?php /* Template Name: Home */ ?>

<?php get_header(); ?>
<?php include 'menu.php'; ?>
<section class="splash splashHome">
	<div class="wrapper grid">
		<video class="bgVideo" poster="<?php echo get_template_directory_uri(); ?>/images/bgFallback.png" loop="true" autoplay>
			<source src="<?php echo get_template_directory_uri(); ?>/images/videoHome.mp4"> 
		</video>
		<!-- <img class="drop" src="<?php echo get_template_directory_uri(); ?>/images/splash.png" alt=""/> -->
		<div class="chamada">
			<h1><?php echo get_field('titulo'); ?></h1>
			<span><?php echo get_field('introducao'); ?></span>
			<?php if (get_field('youtube')){ ?>
				<a href="#" class="botao abreVideo">ASSISTA AO VÍDEO</a>
			<?php } ?>
		</div>
	</div>
</section>

<div class="videoApresentacao">
	<iframe src="https://www.youtube.com/embed/<?php echo get_field('youtube'); ?>" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
	<div class="fechaVideo">
		<div></div>
		<div></div>
	</div>
</div>

<?php if (get_field('educacao') && get_field('pesquisadores') && get_field('projetos') && get_field('artigosnoticias')){ ?>
<section class="chamadaPaginas">
	<div class="wrapper grid">
		<a href="/educacao" class="chamada">
			<img class="icon" src="<?php echo get_template_directory_uri(); ?>/images/icon-educ.svg" alt="icon"/>
			<span class="titulo">Educação</span>
			<span class="descricao"><?php echo get_field('educacao'); ?></span>
		</a>
		<a href="/pesquisadores" class="chamada">
			<img class="icon" src="<?php echo get_template_directory_uri(); ?>/images/icon-pesq.svg" alt="icon"/>
			<span class="titulo">Pesquisadores</span>
			<span class="descricao"><?php echo get_field('pesquisadores'); ?></span>
		</a>
		<a href="/projetos" class="chamada">
			<img class="icon" src="<?php echo get_template_directory_uri(); ?>/images/icon-proj.svg" alt="icon"/>
			<span class="titulo">Projetos</span>
			<span class="descricao"><?php echo get_field('projetos'); ?></span>
		</a>
		<a href="/artigos-noticias" class="chamada">
			<img class="icon" src="<?php echo get_template_directory_uri(); ?>/images/icon-art.svg" alt="icon"/>
			<span class="titulo">Artigos/notícias</span>
			<span class="descricao"><?php echo get_field('artigosnoticias'); ?></span>
		</a>
	</div>
</section>
<?php } ?>

<section class="blog">
	<div class="wrapper">
		<div class="title flexbox">
			<h2>Últimos artigos e notícias</h2>
			<a class="botao" href="<?php echo get_permalink( get_option( 'page_for_posts' ) ); ?>">Veja todos</a>
		</div>
		<ul class="posts">
			<?php 
			$new_query = new WP_Query( array(
			    'posts_per_page' => 3,
			    'post_type'      => 'post',
			    'orderby'        => 'menu_order',
				'status'         => 'published',
				'orderby'		 => 'post_date', 
				'order'          => 'DESC',
			    'paged'          => $paged
			) );

			while ( $new_query->have_posts() ) : $new_query->the_post();  ?>
			
			 	<li><a class="grid" href="<?php echo get_permalink(); ?>">
					<h3><?php echo the_title(); ?></h3>
					<div class="data">
						<span class="date animate"><?php the_time('F, Y') ?></span>
						<span class="categoria 
							<?php
								$categories = get_the_category();
								$nome = esc_html( $categories[0]->name );
								$artigo = 'Artigo';
								$noticia = 'Notícia';
								if (strcmp($nome, $artigo) == 0) {
									echo 'artigo';
								}
								if (strcmp($nome, $noticia) == 0) {
									echo 'noticia';
								}
							?>
							">
							<?php
								

								if ( ! empty( $categories ) ) {
									echo esc_html( $categories[0]->name );	
								}
							?>
						</span>
					</div>
					<div class="resumo animate 
					<?php if(get_the_post_thumbnail( $page->ID)){
						echo 'hasThumb';
					} ?>
					">
						<p><?php the_excerpt(); ?></p>
						<span class="lermais animate">Ler mais ></span>
					</div>
					<?php echo get_the_post_thumbnail( $page->ID, 'large' ); ?>
				</a></li>
			
			<?php endwhile;  
			wp_reset_postdata(); ?>
		</ul>
	</div>

</section>


<?php get_footer(); ?>



Back to Directory File Manager