title: Get the current page custom taxonomy use to query custom post type
body: <p>So far I have a custom taxonomy that is registered called <code>position</code> that is associated with a specific page as well a custom post type called <code>People</code>. I also have a page that has the custom taxonomy set to use the <code>position</code> taxonomy as well.</p>
  
  <p>What I am trying to do is get it so that I can query the custom post type of <code>People</code> to show a list of entries with the custom taxonomy that is set on the page as well as the post type.</p>
  
  <p>For example, the taxonomy of <code>position</code> has some items assigned to it, e.g. - Sales, Accounting, etc. I have some entries for the custom post type of <code>People</code> e.g. - John, Mary, Sam, etc. I have John and Mary set to use the taxonomy of <code>Sales</code>, in this case.</p>
  
  <p>On the page of Sales, I have it set to use the custom <code>position</code> taxonomy of <code>Sales</code>.</p>
  
  <p>What I'm trying to get is get the custom taxonomy of <code>position</code> on the Sales template page which should return the name and/or slug of <code>Sales</code> and then take that info and pass it into a query to check against the <code>People</code> custom post type and pull the associated people from that custom taxonomy. In this case, on the Sales page it should be able to pull the two people of John and Mary.</p>
  
  <p>So far I have this on the Sales template page:</p>
  
  <pre><code>&lt;?php $tax = get_terms( array( 'taxonomy' =&gt; 'position' ) ); ?&gt;
  </code></pre>
  
  <p>That gives me the array of the terms but how do I get the name of the associated taxonomy name that is set on the page and then pass that to a query to get the people?</p>
  
  <p>Looks like if I use <code>get_terms</code> it gives me <strong>everything</strong> and just need the one set taxonomy that is for that particular page, assign that to a variable and then use it for a query like this: </p>
  
  <pre><code>&lt;?php $args = array( 'post_type' =&gt; 'people', 'taxonomy' =&gt; $tax);
  $loop = new WP_Query( $args ); ?&gt;
  </code></pre>