The Loop

The loop is the main process in WordPress. What is included in the loop makes up the body of your blog. You can create individual page templates and circumvent the loop, but then you lose a lot of the rationale behind setting up a site using WordPress, rather than just setting up a website. The [...]

The loop is the main process in WordPress. What is included in the loop makes up the body of your blog. You can create individual page templates and circumvent the loop, but then you lose a lot of the rationale behind setting up a site using WordPress, rather than just setting up a website.

The loop in it’s simplest form is made up of code that looks like:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>

Additional refences: The Loop on the WordPress Codex, The Loop in Action on the WordPress Codex

Leave a Reply

You must be logged in to post a comment.