{"id":1312016,"date":"2009-12-17T23:52:00","date_gmt":"2009-12-17T23:52:00","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/make-posts-use-category-header\/"},"modified":"2016-08-19T14:59:42","modified_gmt":"2016-08-19T14:59:42","slug":"make-posts-use-category-header","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/make-posts-use-category-header\/","title":{"rendered":"Make posts use Category header."},"content":{"rendered":"<p>Hi guys, I have a request for something I believe it&#8217;s not doable in WordPress.<\/p>\n<p>I simply want to have all the posts under a particular category to use the same layout or header at least. I have custom design for all my categories. Using category-id.php &#8230; I have 50 categories and it took me quite some time .. but it&#8217;s relatively easy to maintain, surprisingly. I recently came up with a way to custom search in categories, however, as soon as you select the post, it comes back to the typical layout and it&#8217;s using get_header() &#8230;, Which is a very broad search, considering that I have 514 categories and over 10k posts.<\/p>\n<p>So my question basically is.. <\/p>\n<p>I want all the posts under category .. <strong>bananas<\/strong> .. which is a subcategory of the category <strong>fruit<\/strong> to display my custom header &#8230; bananas_header.php <\/p>\n<p>So basically .. you&#8217;re located at : h<strong>ttp:\/\/www.testdomain.com\/fruit\/bananas\/test-post<\/strong> &#8230; and that particular post is using the bananas_header.php<\/p>\n<p>Is there a way? I spent 2 hours in the codex without any success.<\/p>\n","protected":false},"template":"","class_list":["post-1312016","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1312016","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\/1312016\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=1312016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}