Skip to content

Instantly share code, notes, and snippets.

@garagemwp
Last active August 25, 2018 02:46
Show Gist options
  • Save garagemwp/9594c004b3eb184689f567289463e216 to your computer and use it in GitHub Desktop.
Save garagemwp/9594c004b3eb184689f567289463e216 to your computer and use it in GitHub Desktop.
Estrutura básica de um template single de um tema para WordPress. #2
<?php
/*
Template de Post
Este trecho de código faz parte do artigo: Template de Posts: Série Anatomia de um Tema do WordPress #4
Artigo URL: https://garagemwp.com.br/template-para-posts-tema-wordpress/
*/
?>
<?php get_header(); ?>
<div id="page" class="site">
<?php if( have_posts() ) : the_post(); ?>
<article <?php post_class(); ?>>
<figure><?php the_post_thumbnail('medium'); ?></figure>
<?php the_title('<h1>','</h1>'); ?>
<ul>
<li><?php echo get_the_date(); ?></li>
<li><?php the_category( ', ' ); ?></li>
<li><?php the_tags(); ?></li>
</ul>
<?php the_content(); ?>
</article>
<?php else : ?>
<p>Desculpe-nos, mas nenhum post foi encontrado!</p>
<?php endif; ?>
</div>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment