Thursday 14 November 2013

What is the Loop in WordPress?

Loop is a term used to describe the WordPress community inner loop is used to display each post. Recycled, WordPress handling all posts and displays it on the current page, formatting and filtering. Any HTML, PHP or any other code in the inner loop will be repeated on each post.

The very simple example of The Loop in wordpress is the following code below: 


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

Cycle is a major part of each theme - it is the core of every WordPress website. If you find an instruction placed a piece of code "in the loop" you should take it before ENDWHILE; closed cycle elements.

No comments:

Post a Comment