{"id":393,"date":"2008-07-02T01:46:39","date_gmt":"2008-07-02T10:46:39","guid":{"rendered":"http:\/\/yvod.com\/ulan\/?p=393"},"modified":"2008-07-02T01:46:39","modified_gmt":"2008-07-02T10:46:39","slug":"how-to-create-templates-for-individual-posts-using-wordpress","status":"publish","type":"post","link":"http:\/\/yvod.com\/ulan\/how-to-create-templates-for-individual-posts-using-wordpress\/","title":{"rendered":"How-To create templates for individual posts using WordPress"},"content":{"rendered":"<p>How-To create templates for individual posts using WordPress<\/p>\n<p>I simply adore stuff <a href=\"http:\/\/www.nathanrice.net\/blog\/wordpress-single-post-templates\/\" target=\"_blank\">like this<\/a>. While it took me 15 or 20 minutes to figure out what they were talking about, once I did it was both elegant and easy to replicate. Open Source Rocks!<\/p>\n<p><strong>The Problem<\/strong><\/p>\n<p>WordPress allows you to easily create templates for &#8220;<a href=\"http:\/\/codex.wordpress.org\/Pages\" target=\"_blank\">Pages<\/a>&#8221; and entire <a href=\"http:\/\/codex.wordpress.org\/Category_Templates\" target=\"_blank\">categories<\/a>. This is very handy and easy to implement. <\/p>\n<p>WordPress does not make it easy to create a template for a single post. <\/p>\n<p>In my case, I needed the first post in a category to have a special link for the &#8220;previous-link&#8221; navigation. Additionally, the last post needed the same link for the &#8220;next-link&#8221; navigation. (Normally, the first post would have a blank right navigation since there is no previous post and the last post would have a blank left one since there is no next post.)<\/p>\n<p><strong>The Solution<\/strong><\/p>\n<p>In order to create a category template you have to name the template file <em>category-n.php<\/em> where &#8220;n&#8221; is the category ID. [<strong>Hint:<\/strong> Select Manage > Category > Your Category and then look at the URL &#8211; it will contain the category ID!]<\/p>\n<p>Well <a href=\"http:\/\/www.nathanrice.net\/blog\/wordpress-single-post-templates\/\" target=\"_blank\">these guys<\/a> figured out how to do the same thing by creating similar category templates and then assigning your post to that category. The >>REALLY<< cool and elegant thing is that the \"update\" by <a href=\"http:\/\/www.ilfilosofo.com\/\" target=\"_blank\">Austin<\/a> allows you to place a post in multiple categories (the real one and the template one).<\/p>\n<p>Thanx gentlemen! <\/p>\n","protected":false},"excerpt":{"rendered":"<p>How-To create templates for individual posts using WordPress I simply adore stuff like this. While it took me 15 or 20 minutes to figure out what they were talking about, once I did it was both elegant and easy to replicate. Open Source Rocks! The Problem WordPress allows you to easily create templates for &#8220;Pages&#8221; &#8230; <a title=\"How-To create templates for individual posts using WordPress\" class=\"read-more\" href=\"http:\/\/yvod.com\/ulan\/how-to-create-templates-for-individual-posts-using-wordpress\/\" aria-label=\"Read more about How-To create templates for individual posts using WordPress\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-393","post","type-post","status-publish","format-standard","hentry","category-code-computers"],"_links":{"self":[{"href":"http:\/\/yvod.com\/ulan\/wp-json\/wp\/v2\/posts\/393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/yvod.com\/ulan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yvod.com\/ulan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yvod.com\/ulan\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/yvod.com\/ulan\/wp-json\/wp\/v2\/comments?post=393"}],"version-history":[{"count":0,"href":"http:\/\/yvod.com\/ulan\/wp-json\/wp\/v2\/posts\/393\/revisions"}],"wp:attachment":[{"href":"http:\/\/yvod.com\/ulan\/wp-json\/wp\/v2\/media?parent=393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yvod.com\/ulan\/wp-json\/wp\/v2\/categories?post=393"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yvod.com\/ulan\/wp-json\/wp\/v2\/tags?post=393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}