title: WordPress get category ID to Array
body: <p>I have this code in <code>category.php</code> and I want to show posts from the category in which I am, "<code>$cat</code>" and the category referred to <code>id</code> 63. I wrote something but do not want to work :/</p>
  
  <pre><code>&lt;?php
  $cat-&gt;term_id;
  $my_query_args = array(
      'posts_per_page' =&gt; 6,
      'tax_query' =&gt; array(
          array(
              'taxonomy' =&gt; 'category',
              'field' =&gt; 'id',
              'terms' =&gt; array(63, $cat),
              'operator' =&gt; 'AND'
          )
      )
  );
  $my_query = new WP_Query($my_query_args);
  if ($my_query-&gt;have_posts()) : while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post();
  
          ?&gt;
          &lt;li&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;
      &lt;?php
      endwhile;
  endif;
  wp_reset_postdata();
  
  ?&gt;
  </code></pre>
  
  <p>Can someone tell me why do not incur the currently displayed category to <code>$cat</code>?</p>
  
  <p>Thanks in advance for your help!</p>