What is Wordpress loop?

kumkumsharma

Administrator
Staff member
Its a PHP code to display Wordpress posts, this code is used to display all the posts in a page.

Here is the example of code:

Below is an example of a simple WordPress Loop.

Code:
<?php
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
//
// Post Content here
//
endwhile; // end while
endif; // end if
?>
 
Top