Viewing File: /home/cienp/public_html/inct-inovamed/wp-content/themes/inovamed/template-posts.php
<?php /* Template Name: Posts */ ?>
<?php get_header(); ?>
<?php include 'menu.php'; ?>
<section class="splash splashPesquisadores">
<div class="wrapper grid">
<h1 class="title">ARTIGOS E NOTÍCIA DO INOVAMED</h1>
</div>
</section>
<section class="postsDestaque">
<div class="wrapper owl-carousel">
<?php
$new_query = new WP_Query( array(
'posts_per_page' => 5,
'post_type' => 'post',
'orderby' => 'menu_order',
'status' => 'published',
'orderby' => 'post_date',
'order' => 'DESC',
) );
while ( $new_query->have_posts() ) : $new_query->the_post(); ?>
<a href="<?php echo get_permalink(); ?>">
<div class="texto">
<h3><?php echo the_title(); ?></h3>
<span class="lermais animate">Ler mais ></span>
</div>
<?php echo get_the_post_thumbnail( $page->ID, 'large' ); ?>
</a>
<?php endwhile;
wp_reset_postdata(); ?>
</div>
</section>
<section class="blog">
<div class="wrapper">
<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