{"action":"created","issue":{"url":"https://api.github.com/repos/rilwis/meta-box/issues/325","labels_url":"https://api.github.com/repos/rilwis/meta-box/issues/325/labels{/name}","comments_url":"https://api.github.com/repos/rilwis/meta-box/issues/325/comments","events_url":"https://api.github.com/repos/rilwis/meta-box/issues/325/events","html_url":"https://github.com/rilwis/meta-box/issues/325","id":15900726,"number":325,"title":"Metabox of Child Theme doesn't work","user":{"login":"DummyRobot","id":4765961,"avatar_url":"https://avatars.githubusercontent.com/u/4765961?v=3","gravatar_id":"","url":"https://api.github.com/users/DummyRobot","html_url":"https://github.com/DummyRobot","followers_url":"https://api.github.com/users/DummyRobot/followers","following_url":"https://api.github.com/users/DummyRobot/following{/other_user}","gists_url":"https://api.github.com/users/DummyRobot/gists{/gist_id}","starred_url":"https://api.github.com/users/DummyRobot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DummyRobot/subscriptions","organizations_url":"https://api.github.com/users/DummyRobot/orgs","repos_url":"https://api.github.com/users/DummyRobot/repos","events_url":"https://api.github.com/users/DummyRobot/events{/privacy}","received_events_url":"https://api.github.com/users/DummyRobot/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2013-06-23T19:04:13Z","updated_at":"2015-02-19T16:42:39Z","closed_at":"2013-06-28T17:19:30Z","body":"First of, thanks for this great plugin.\r\n\r\nI have a issue registering metaboxes in child themes.\r\nI have TwentyEleven with the demo.php included and it works fine.\r\n\r\nI had made a child theme of TwentyEleven and included a child-metabox.php with the following code for a simple checkbox:\r\n\r\n```?php\r\n$prefix = 'child_';\r\n\r\nglobal $meta_boxes;\r\n\r\n$meta_boxes = array();\r\n\r\n// 1st meta box\r\n$meta_boxes[] = array(\r\n\t'id' => 'child_standard',\r\n\t'title' => __( 'Checkbox Meta Box', 'rwmb' ),\r\n\t'pages' => array( 'post', 'page' ),\r\n\t'context' => 'normal',\r\n\t'priority' => 'high',\r\n\t'autosave' => true,\r\n\r\n\t// List of meta fields\r\n\t'fields' => array\r\n\t\t// CHECKBOX\r\n\t\tarray(\r\n\t\t\t'name' => __( 'Checkbox', 'rwmb' ),\r\n\t\t\t'id'   => \"{$prefix}checkbox\",\r\n\t\t\t'type' => 'checkbox',\r\n\t\t\t// Value can be 0 or 1\r\n\t\t\t'std'  => 1,\r\n\t\t),\r\n\t)\r\n);\r\n\r\nfunction child_register_meta_boxes()\r\n{\r\n\tif ( !class_exists( 'RW_Meta_Box' ) )\r\n\t\treturn;\r\n\r\n\tglobal $meta_boxes;\r\n\tforeach ( $meta_boxes as $meta_box )\r\n\t{\r\n\t\tnew RW_Meta_Box( $meta_box );\r\n\t}\r\n}\r\nadd_action( 'admin_init', 'child_register_meta_boxes' );\r\n```\r\nNothing appears in my posts & pages, just the default demo.php metaboxes from the parent theme.\r\n\r\nIf i paste this metabox code in the parent theme demo.php it all works, but if i call it separately in the child it doesn't.\r\n\r\nI've tried this a couple times with a clean wp 3.5 install + twentyeleven with no luck.\r\nTried on my server and in my localhost.\r\n\r\nIs this a limitation on this plugin? I can't register new metaboxes on a child theme? or am i doing something wrong?\r\n\r\nThanks in advance.\r\n"},"comment":{"url":"https://api.github.com/repos/rilwis/meta-box/issues/comments/75086764","html_url":"https://github.com/rilwis/meta-box/issues/325#issuecomment-75086764","issue_url":"https://api.github.com/repos/rilwis/meta-box/issues/325","id":75086764,"user":{"login":"rilwis","id":668274,"avatar_url":"https://avatars.githubusercontent.com/u/668274?v=3","gravatar_id":"","url":"https://api.github.com/users/rilwis","html_url":"https://github.com/rilwis","followers_url":"https://api.github.com/users/rilwis/followers","following_url":"https://api.github.com/users/rilwis/following{/other_user}","gists_url":"https://api.github.com/users/rilwis/gists{/gist_id}","starred_url":"https://api.github.com/users/rilwis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rilwis/subscriptions","organizations_url":"https://api.github.com/users/rilwis/orgs","repos_url":"https://api.github.com/users/rilwis/repos","events_url":"https://api.github.com/users/rilwis/events{/privacy}","received_events_url":"https://api.github.com/users/rilwis/received_events","type":"User","site_admin":false},"created_at":"2015-02-19T16:42:39Z","updated_at":"2015-02-19T16:42:39Z","body":"Hi, this thread uses old method to register meta boxes. Please follow [this documentation](http://metabox.io/docs/registering-meta-boxes/) to register meta boxes. It works in all cases, no matter that is parent theme or child theme."}}