Skip to content

Instantly share code, notes, and snippets.

@garagemwp
Created June 16, 2018 06:33
Show Gist options
  • Save garagemwp/07d70f87c9b91a56a2371aca9393327a to your computer and use it in GitHub Desktop.
Save garagemwp/07d70f87c9b91a56a2371aca9393327a to your computer and use it in GitHub Desktop.
Exemplo básico de um template de página inicial para WordPress
<?php get_header(); ?>
<div id="page" class="site">
<header>
<h1><?php bloginfo( 'name' ); ?></h1>
</header>
<?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 echo paginate_links(); ?>
<?php endif; ?>
</div>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment