Skip to content

Instantly share code, notes, and snippets.

@barbrick
Last active August 29, 2015 14:06
Show Gist options
  • Save barbrick/bfae17fefbe9629c6965 to your computer and use it in GitHub Desktop.
Save barbrick/bfae17fefbe9629c6965 to your computer and use it in GitHub Desktop.
The Loop
<?php
$args = array();
$loop = new WP_Query($args);
?>
<?php if ( $loop->have_posts() ) : while ( $loop->have_posts() ) : $loop->the_post(); ?>
<h2><?php the_title(); ?></h2>
<div class="entry">
<?php the_content(); ?>
</div>
<?php endwhile; else : ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment