Viewing File: /home/cienp/public_html/inct-inovamed/wp-content/themes/inovamed/archive.php
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
*
*/
get_header();
?>
<!-- archive.php -->
<?php
$category = get_category( get_query_var( 'cat' ) );
$cat_id = $category->cat_ID; ?>
<?php include 'menu.php'; ?>
<section class="splash splashPesquisadores">
<div class="wrapper grid">
<h1 class="title"><?php echo $category->name; ?>S</h1>
</div>
</section>
<section class="blog">
<div class="wrapper" id="ultimosPosts">
<ul class="posts">
<?php while ( have_posts() ) : 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