title: Transform a code in to a function
body: <p>How to transform this code :</p>
  
  <pre><code>    &lt;?php
                      if(have_posts()):
  
                      $end = array(3,6,9,12,15,18,21,24,27,30,33,36,39,42,45);
                      $a = 0;
                      while (have_posts()) : the_post();
                      $a++;
                      global $post;
                  ?&gt;
                  &lt;li class="item_list&lt;?php if (in_array($a, $end)) { echo " right"; } ?&gt;"&gt;
  </code></pre>
  
  <p>in to a function that would start like this</p>
  
  <pre><code>$display = 
  </code></pre>
  
  <p>Thank YOu so much in advance :)</p>