{"id":1707,"date":"2014-01-24T11:01:08","date_gmt":"2014-01-24T09:01:08","guid":{"rendered":"http:\/\/www.extradrm.com\/?p=1707"},"modified":"2014-01-24T11:15:39","modified_gmt":"2014-01-24T09:15:39","slug":"drupal-7-building-a-sub-theme-from-zen","status":"publish","type":"post","link":"http:\/\/www.extradrm.com\/?p=1707","title":{"rendered":"Drupal 7 : Building a sub theme from Zen"},"content":{"rendered":"<h2>Why Zen theme ?<\/h2>\n<p>The Zen theme is the nat\u00adural first step when them\u00ading Dru\u00adpal. It reduces Dru\u00adpal down to the essen\u00adtials, allow\u00ading for a solid foun\u00adda\u00adtion to build up from. The alter\u00adna\u00adtive? Copy\u00ading files from the core themes is messy, and start\u00ading from scratch is time-consuming.<\/p>\n<p>Down\u00adload the <a href=\"http:\/\/drupal.org\/project\/zen\" target=\"_blank\">Zen Theme<\/a>. Included is the base zen theme and sub-theme tem\u00adplate, STARTERKIT.<\/p>\n<p>Copy every\u00adthing into sites\/all\/themes\/zen on your web server. Move the STARTERKIT folder up a level into sites\/all\/themes.\u00a0Separating\u00a0the base theme makes upgrad\u00ading zen the sim\u00adple mat\u00adter of over\u00adwrit\u00ading the zen folder with the newer ver\u00adsion. Files within the zen folder will remain unal\u00adtered. All con\u00adfig\u00adu\u00adra\u00adtion is done within the STARTERKIT sub-theme.<\/p>\n<p><a href=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen0.jpg\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1712\" alt=\"drupal_subzen0\" src=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen0.jpg\" width=\"216\" height=\"412\" srcset=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen0.jpg 216w, http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen0-157x300.jpg 157w\" sizes=\"(max-width: 216px) 100vw, 216px\" \/><\/a>Copy every\u00adthing into sites\/all\/themes\/zen on your web server. Move the STARTERKIT folder up a level into sites\/all\/themes.\u00a0Separating\u00a0the base theme makes upgrad\u00ading zen the sim\u00adple mat\u00adter of over\u00adwrit\u00ading the zen folder with the newer ver\u00adsion. Files within the zen folder will remain unal\u00adtered. All con\u00adfig\u00adu\u00adra\u00adtion is done within the STARTERKIT sub-theme.<\/p>\n<p><a href=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen.jpg\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1711\" alt=\"drupal_subzen\" src=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen.jpg\" width=\"766\" height=\"587\" srcset=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen.jpg 884w, http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen-300x230.jpg 300w\" sizes=\"(max-width: 766px) 100vw, 766px\" \/><\/a><\/p>\n<p>Rename the folder \u201cSTARTERKIT\u201d and \u201cSTARTERKIT.info.txt\u201d file to match your new theme and remove \u201c.txt\u201d exten\u00adsion. For exam\u00adple, \u201cmysubzen\u201d and \u201cmysubzen.info\u201d. Open that info file and change the fol\u00adlow\u00ading\u00a0lines:<\/p>\n<p>name and description at your convenience as shown above &#8230;<\/p>\n<p>Also Add line stylesheets[all][] = css\/style.css and create this empty file style.css which will override every existing zen style from parent.<\/p>\n<p><a href=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen2.jpg\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1709\" alt=\"drupal_subzen2\" src=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen2.jpg\" width=\"579\" height=\"383\" srcset=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen2.jpg 785w, http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen2-300x198.jpg 300w\" sizes=\"(max-width: 579px) 100vw, 579px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>For example the style.css below will give this appearance (use firebug to locate classes and div tags) :<\/p>\n<p><a href=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen1.jpg\"><img loading=\"lazy\" class=\"aligncenter\" alt=\"drupal_subzen1\" src=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen1.jpg\" width=\"565\" height=\"375\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen_sample.jpg\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1715\" alt=\"drupal_subzen_sample\" src=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen_sample.jpg\" width=\"716\" height=\"424\" srcset=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen_sample.jpg 1058w, http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen_sample-300x177.jpg 300w, http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/drupal_subzen_sample-1024x605.jpg 1024w\" sizes=\"(max-width: 716px) 100vw, 716px\" \/><\/a><\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Do not Forget Templates files :<\/strong><\/span><\/p>\n<ol>\n<li><strong>Edit your sub-theme to use the proper function names.<\/strong>Edit the template.php and theme-settings.php files in your sub-theme&#8217;s folder; replace ALL occurrences of &#8220;STARTERKIT&#8221; with the name of your sub-theme.\n<p>For example, edit mysubzen\/template.php and mysubzen\/theme-settings.php and replace every occurrence of &#8220;STARTERKIT&#8221; with &#8220;mysubzen&#8221;.<\/p>\n<p>It is recommended to use a text editing application with search and &#8220;replace all&#8221; functionality.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"text-decoration: underline;\">Important Note :<\/span><\/strong><\/p>\n<p>Remem\u00adber to des\u00ade\u00adlect \u201cRebuild theme reg\u00adistry on every page.\u201d in Admin&gt;Appearance&gt;Settings(sub-theme)<\/p>\n<p><a href=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/theme_development.png\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1708\" alt=\"theme_development\" src=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/theme_development.png\" width=\"470\" height=\"113\" srcset=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/theme_development.png 470w, http:\/\/www.extradrm.com\/wp-content\/uploads\/2014\/01\/theme_development-300x72.png 300w\" sizes=\"(max-width: 470px) 100vw, 470px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Why Zen theme ? The Zen theme is the nat\u00adural first step when them\u00ading Dru\u00adpal. It reduces Dru\u00adpal down to the essen\u00adtials, allow\u00ading for a solid foun\u00adda\u00adtion to build up from. The alter\u00adna\u00adtive? Copy\u00ading&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":2842,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[139,6],"tags":[],"youtube_video":null,"_links":{"self":[{"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/1707"}],"collection":[{"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1707"}],"version-history":[{"count":0,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/1707\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/media\/2842"}],"wp:attachment":[{"href":"http:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1707"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}