Sign Up For Web Hosting Now!
WordPress Services
No.1 Wordpress Host
  • Free Domain name
  • Unlimited space
  • Unlimited traffic
  • 99.9% Server Uptime
  • FREE WP installation
  • Wordpress themes
  • Immediate activation
Buy web hosting
Sign up now Learn more
WordPress Hosting Award
WordPress Hosting Award
Facebook Twitter Plusone

What is The Loop

The Loop is a term used in the WordPress community to describe the internal cycle used to display each of your posts. Using The Loop, WordPress processes all posts and displays them on the current page, formatted and filtered. Any HTML, PHP or other code placed within The Loop will be repeated on each post.

The most simple example of The Loop is the following code:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php endwhile; endif; ?>

The Loop is the main part of each theme - it is the core of each WordPress site. If you find a instruction to place piece of code "within The Loop" you should place it before the endwhile; element that closes the cycle.

Previous Next
(c) Copyright 2004-2013 SiteGround. All rights reserved
WordPress is a trademark of Free Software Foundation, Inc. SiteGround is not affiliated with or endorsed by the WordPress Project or its trademark owners.