{"id":1316197,"date":"2009-12-21T13:56:41","date_gmt":"2009-12-21T13:56:41","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/hide-posts-in-child-categories\/"},"modified":"2016-08-19T15:01:24","modified_gmt":"2016-08-19T15:01:24","slug":"hide-posts-in-child-categories","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/hide-posts-in-child-categories\/","title":{"rendered":"Hide posts in child categories"},"content":{"rendered":"<p>If I am on a category archive page, by default it will show all posts within that category and posts within any child categories. I would like to display only those that are directly attributed to the parent category. How would I go about excluding posts that are in child categories?<\/p>\n<p>I have tried to do this with a custom query using both cat_id and category_name, but it seems to still bring in posts.<\/p>\n","protected":false},"template":"","class_list":["post-1316197","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1316197","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":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1316197\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=1316197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}