<!-- Start the Loop. -->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if (in_category('theses')) : ?>
<article class="post item mb9 <?php echo SLUG-DA-CATEGORIA; ?>">
<h3><?php echo NOME-DA-CATEGORIA; ?></h3>
<p class=" date color-secondary"><?php the_time('Y'); ?></p>
<h3 class="title-post"><?php the_title(); ?></h3>
<p class="text color-secondary">
<?php
$pdf = get_field('pdf');
$bib = get_field('bib');
$amazon = get_field('amazon');
?>
<?php if ($pdf) : ?>
[<a href="<?php the_field('pdf') ?>">PDF</a>]
<?php endif; ?>
<?php if ($bib) : ?>
[<a href="<?php the_field('bib') ?>">Bib</a>]
<?php endif; ?>
<?php if ($amazon) : ?>
[<a href="<?php the_field('amazon') ?>">Amazon</a>]
<?php endif; ?>
</p>
</article>
<?php else : ?>
<article class="post item mb9 <?php echo SLUG_DA_CATEGORIA; ?>">
<h3><?php echo NOME-DA-CATEGRIA; ?> </h3>
<p><?php the_time('Y'); ?></p>
<?php
$content = get_the_content();
$content = str_replace('<p', '<p class="text color-secondary"', $content);
?>
<?php echo $content ?>
</article>
<?php endif; ?>
<?php endwhile;
else : ?>
<p><?php esc_html_e('Sorry, no posts matched your criteria.'); ?></p>
<!-- stop The Loop. -->
<?php endif; ?>