Skip to content

Instantly share code, notes, and snippets.

@sguzik
Created May 1, 2012 17:12
Show Gist options
  • Save sguzik/2569719 to your computer and use it in GitHub Desktop.
Save sguzik/2569719 to your computer and use it in GitHub Desktop.
The most basic PHP loop
/* The loop starts here:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
/* and ends here:
<?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