Skip to content

Instantly share code, notes, and snippets.

@temazinkin
Created October 6, 2015 08:02
Show Gist options
  • Save temazinkin/2179dc310840b0941db3 to your computer and use it in GitHub Desktop.
Save temazinkin/2179dc310840b0941db3 to your computer and use it in GitHub Desktop.
main loop wordpress
<!-- Start the Loop. -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="post">
<h2>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
<?php the_title(); ?>
</a>
</h2>
<small>
<?php the_time('F jS, Y'); ?> by <?php the_author_posts_link(); ?>
</small>
<div class="entry">
<?php the_content(); ?>
</div>
<p class="postmetadata">
<?php _e( 'Posted in' ); ?> <?php the_category( ', ' ); ?>
</p>
</div>
<?php endwhile; else : ?>
<p>
<?php _e( 'Sorry, no posts matched your criteria.' ); ?>
</p>
<?php endif; ?>
<!-- Stop The Loop. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment