The above technique is the first way of using the loop, the code above has been taken from the default twenty twelve template which comes with the default Wordpress install.<div><br></div><div>Notice the while loop, if you are not familiar with PHP or any popular programming language, the while loop is one of the available loops a developer can choose from.</div><div>The while loop continues until the set condition has changed, in this case the loop will continue until no more posts are available to show.</div><div>The next important part is the_post(); this will call all the required information we need to display the post to the user.</div><div><br></div><div>Inside the post we have a number of functions, such as the_title(), the_content() and so on.</div><div>These functions will allow us to show different parts of the post, the title is displayed using the_title(), but if we want the title but don't want it to print we will use get_the_title().</div><div><br></div><div>I will write down all the available functions at the end of this article.</div><div><br></div><div>The final part to this loop is the endwhile, this is used to end the while loop, an alternative way of writing the while loop is with brackets such as</div>
The above technique is the first way of using the loop, the code above has been taken from the default twenty twelve template which comes with the default Wordpress install.
Notice the while loop, if you are not familiar with PHP or any popular programming language, the while loop is one of the available loops a developer can choose from.
The while loop continues until the set condition has changed, in this case the loop will continue until no more posts are available to show.
The next important part is the_post(); this will call all the required information we need to display the post to the user.
Inside the post we have a number of functions, such as the_title(), the_content() and so on.
These functions will allow us to show different parts of the post, the title is displayed using the_title(), but if we want the title but don't want it to print we will use get_the_title().
I will write down all the available functions at the end of this article.
The final part to this loop is the endwhile, this is used to end the while loop, an alternative way of writing the while loop is with brackets such as