{"id":11773696,"date":"2019-07-27T17:48:52","date_gmt":"2019-07-27T17:48:52","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/getting-details\/"},"modified":"2019-07-27T17:49:44","modified_gmt":"2019-07-27T17:49:44","slug":"getting-details","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/getting-details\/","title":{"rendered":"Getting details"},"content":{"rendered":"<p>I have a post type called &#8220;lab&#8221; which has a taxonomy called &#8220;states&#8221;.<\/p>\n<p>I added this plugin and created a new post called &#8220;careers&#8221; and added a CPT &#8220;lab&#8221; as its taxonomy.<\/p>\n<p>So this is the order<\/p>\n<p>States<br \/>\n&#8211; Labs<br \/>\n&#8211;Careers<\/p>\n<p><strong>When I click on a state I get its slug and list all &#8220;Lab&#8221; now I need to get all Careers that I added to a lab<\/strong><\/p>\n<p>How can I get it? I tried the code below:<\/p>\n<pre><code>$args = array(\n\t&#039;post_type&#039; =&gt; &quot;careers&quot;,\n\t&#039;tax_query&#039; =&gt; array(\n&#039;taxonomy&#039; =&gt; &#039;lab&#039;,\n\t&#039;field&#039; =&gt; &#039;slug&#039;,\n\t&#039;terms&#039; =&gt; &#039;global-pathology&#039;,\n\t\t\t\t\t\t\t\t\t&#039;include_children&#039; =&gt; false\n\t),\n\n\t&#039;posts_per_page&#039; =&gt; -1,\n      &#039;orderby&#039; =&gt; &#039;date&#039;,\n\t &#039;order&#039; =&gt; &#039;DESC&#039;);\n\t$posts = get_posts($args);<\/code><\/pre>\n<p>But it&#8217;s not filtering by lab taxonomy<\/p>\n","protected":false},"template":"","class_list":["post-11773696","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11773696","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11773696\/revisions"}],"predecessor-version":[{"id":11773698,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11773696\/revisions\/11773698"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=11773696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}