Skip to content

Instantly share code, notes, and snippets.

@leocristofani
Last active December 15, 2015 21:50
Show Gist options
  • Save leocristofani/5328991 to your computer and use it in GitHub Desktop.
Save leocristofani/5328991 to your computer and use it in GitHub Desktop.
The famous WordPress Loop, inspired by http://undercores.me starter template.
<?php if(have_posts()) : ?>
<?php while(have_posts()) : the_post(); // start the loop ?>
<?php get_template_part('partials/content', get_post_format()); ?>
<?php endwhile; // end the loop ?>
<?php else : ?>
<?php get_template_part('partials/no-results.php'); // display "no posts found" message ?>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment