Created
February 20, 2012 04:45
-
-
Save krogsgard/1867897 to your computer and use it in GitHub Desktop.
The Basic WordPress Loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
<?php // You can do stuff here to display aspects of the posts which meet the criteria of the current loop. ?> | |
<?php endwhile; else: ?> | |
<p><?php _e('The Loop did not find anything.'); ?></p> | |
<?php endif; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( have_posts() ) { | |
while ( have_posts() ) { | |
the_post(); | |
// You can do stuff here to display aspects of the posts which meet the criteria of the current loop. | |
} | |
} else { ?> | |
<p><?php _e('The Loop did not find anything.'); ?></p> | |
<?php } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment