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


<!-- search.php -->

<?php get_header(); 
$s = get_search_query(); ?>
<?php include 'menu.php'; ?>
<section class="splash splashPesquisadores">
	<div class="wrapper grid">
		<h1 class="title">Busca por '<?php echo $s; ?>'</h1>
	</div>
</section>

<section class="blog">
	<div class="wrapper" id="ultimosPosts">
		<ul class="posts">
			<?php 
			
			$new_query = new WP_Query( array(
			    'post_type'      => 'post',
			    'orderby'        => 'menu_order',
				'status'         => 'published',
				'orderby'		 => 'post_date', 
				'order'          => 'DESC',
				's' 			 =>	$s,
			) );

			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