title: Wordpress's loop
body: <pre><code>&lt;?php if(have_posts()) : while(have_posts()) : the_post(); ?&gt;
  </code></pre>
  
  <p>While it use <code>while(have_posts())</code>, I feel it's useless. Suppose it doesn't have the while condition, the first <code>if(have_posts())</code> to check the block whether have a post. If there is no post, the programme goes out the loop. if there is a post, then execute <code>the_post()</code>. Any tips would be appreciated.</p>