while(have_posts()) {} This in built function of php runs the following program we have posts. But 1 concept in not clear yet. This while loop will run n number of times or if we don't use or fetch the post using while loop then will the loop go infinite times? To understand this we must be clear of the for loop If we use the_post(); function of wordpress then only we can make the loop finite. Make sure to use the_post(); to fetch the post and this is important to finish the loop. Else the while loop will go infinite. Example of correct loop : <?php while ( have_posts () ){ the_post (); echo " hello " ; } ? > The above loop will print hello = no. of posts. Example of incorrect loop : <?php while ( have_posts () ){ echo " hello " ; } ? > The above loop will print hello infinite no. of times. ...