title: Wordpress WP_Query
body: <p>I have code for my carousel in Wordpress </p>
  
  <pre><code>&lt;?php 
      $the_query = new WP_Query(array(
       'category_name' =&gt; 'home-slider', 
       'posts_per_page' =&gt; 5  
      )); 
      while ( $the_query-&gt;have_posts() ) : 
      $the_query-&gt;the_post();
  ?&gt;
  &lt;div class="sl-slide"&gt;
   &lt;?php the_post_thumbnail('large');?&gt;
   &lt;div class="sl-slide-inner"&gt;
   &lt;?php the_title();?&gt;
   &lt;?php the_excerpt();?&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;?php 
  endwhile; 
  wp_reset_postdata();
  ?&gt;
  </code></pre>
  
  <p>I display 5 post in carousel. I want basic If-else statment where for every page I create static variable. for instance:.</p>
  
  <pre><code>if (post == 1) {
   $aka = 7;
  } else if (post == 2) {
   $aka = 8;
  } else if (post == 3) {
   $aka = 9;
  } .. and etc.
  </code></pre>
  
  <p>I can't figure it out how to implement it in WP, how to say which post is now?</p>