{"id":3493,"date":"2014-03-27T04:50:19","date_gmt":"2014-03-27T04:50:19","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/27\/custom-theme-doesnt-show-up-in-blocks-section-collection-of-common-programming-errors\/"},"modified":"2014-03-27T04:50:19","modified_gmt":"2014-03-27T04:50:19","slug":"custom-theme-doesnt-show-up-in-blocks-section-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/27\/custom-theme-doesnt-show-up-in-blocks-section-collection-of-common-programming-errors\/","title":{"rendered":"Custom theme doesn&#39;t show up in Blocks section-Collection of common programming errors"},"content":{"rendered":"<p>The error you are getting is caused from the fact the name is missing from the .info file for your theme.<br \/>\nIn block_menu(), the code that is causing the error is the following one.<\/p>\n<pre><code>$items['admin\/structure\/block\/list\/' . $key] = array(\n  'title' =&gt; check_plain($theme-&gt;info['name']), \n  'page arguments' =&gt; array($key), \n  'type' =&gt; $key == $default_theme ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK, \n  'weight' =&gt; $key == $default_theme ? -10 : 0, \n  'access callback' =&gt; '_block_themes_access', \n  'access arguments' =&gt; array($theme), \n  'file' =&gt; 'block.admin.inc',\n);\n<\/code><\/pre>\n<pre><code>$items['admin\/structure\/block\/demo\/' . $key] = array(\n  'title' =&gt; check_plain($theme-&gt;info['name']), \n  'page callback' =&gt; 'block_admin_demo', \n  'page arguments' =&gt; array($key), \n  'type' =&gt; MENU_CALLBACK, \n  'access callback' =&gt; '_block_themes_access', \n  'access arguments' =&gt; array($theme), \n  'theme callback' =&gt; '_block_custom_theme', \n  'theme arguments' =&gt; array($key), \n  'file' =&gt; 'block.admin.inc',\n);\n<\/code><\/pre>\n<p>In system_menu(), the code causing the error is the following one.<\/p>\n<pre><code>  foreach (list_themes() as $theme) {\n    $items['admin\/appearance\/settings\/' . $theme-&gt;name] = array(\n      'title' =&gt; $theme-&gt;info['name'], \n      'page arguments' =&gt; array('system_theme_settings', $theme-&gt;name), \n      'type' =&gt; MENU_LOCAL_TASK, \n      'access callback' =&gt; '_system_themes_access', \n      'access arguments' =&gt; array($theme), \n      'file' =&gt; 'system.admin.inc',\n    );\n  }\n<\/code><\/pre>\n<p>In all the cases, the error is raised when Drupal tries to access <code>$theme-&gt;info['name']<\/code>, but the &#8220;name&#8221; index is not defined.<\/p>\n<p>Be sure there isn&#8217;t any strange Unicode character before <code>name =<\/code>, especially an invisible character.<\/p>\n<p>If you are editing the .info file of the theme when the theme is enabled, you need to first disable it, and re-enable it, as the content of the .info file is cached.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The error you are getting is caused from the fact the name is missing from the .info file for your theme. In block_menu(), the code that is causing the error is the following one. $items[&#8216;admin\/structure\/block\/list\/&#8217; . $key] = array( &#8216;title&#8217; =&gt; check_plain($theme-&gt;info[&#8216;name&#8217;]), &#8216;page arguments&#8217; =&gt; array($key), &#8216;type&#8217; =&gt; $key == $default_theme ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3493","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3493","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3493"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3493\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}