Last active
June 16, 2018 05:44
-
-
Save garagemwp/0e8d84b7ee712edf05b3fe0ceccd8330 to your computer and use it in GitHub Desktop.
Exemplo básico de um loop para exibir os posts recentes no WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( have_posts() ) : ?> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<article <?php post_class(); ?>> | |
<?php the_title('<h2>','</h2>'); ?> | |
<p><?php echo get_the_date(); ?></p> | |
<?php the_post_thumbnail( 'thumbnail' ); ?> | |
<?php the_excerpt(); ?> | |
<a href="<?php echo get_permalink(); ?>">Leia mais</a> | |
</article> | |
<?php endwhile; ?> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Exemplo criado para fins didáticos.