File: /var/www/sites/30291/public_html/wp-content/themes/fernanda-menezes/single.php
<?php get_header(); ?>
<main id="conteudo">
<?php while (have_posts()) : the_post(); ?>
<section class="section single-post-section">
<div class="section-inner single-post-grid">
<article <?php post_class('single-post-article'); ?>>
<header class="single-post-header">
<p class="eyebrow">Artigo</p>
<h1><?php the_title(); ?></h1>
<div class="post-meta">
<time datetime="<?php echo esc_attr(get_the_date('c')); ?>"><?php echo esc_html(get_the_date()); ?></time>
<?php if (has_category()) : ?>
<span><?php the_category(', '); ?></span>
<?php endif; ?>
</div>
</header>
<?php if (has_post_thumbnail()) : ?>
<figure class="single-post-featured">
<?php the_post_thumbnail('large'); ?>
</figure>
<?php endif; ?>
<div class="single-post-content">
<?php the_content(); ?>
</div>
</article>
<aside class="single-post-sidebar" aria-label="Conteúdos relacionados">
<div class="sidebar-card">
<p class="eyebrow">Continue lendo</p>
<h2>Artigos recentes</h2>
<div class="sidebar-posts">
<?php
$recent_posts = new WP_Query(array(
'posts_per_page' => 3,
'post_status' => 'publish',
'post__not_in' => array(get_the_ID()),
'ignore_sticky_posts' => true,
));
?>
<?php if ($recent_posts->have_posts()) : ?>
<?php while ($recent_posts->have_posts()) : $recent_posts->the_post(); ?>
<a class="sidebar-post" href="<?php the_permalink(); ?>">
<?php if (has_post_thumbnail()) : ?>
<?php the_post_thumbnail('thumbnail'); ?>
<?php endif; ?>
<span>
<strong><?php the_title(); ?></strong>
<small><?php echo esc_html(get_the_date()); ?></small>
</span>
</a>
<?php endwhile; wp_reset_postdata(); ?>
<?php else : ?>
<p class="muted">Novos artigos aparecerão aqui.</p>
<?php endif; ?>
</div>
</div>
</aside>
</div>
</section>
<?php endwhile; ?>
</main>
<?php get_footer(); ?>