{"id":9174194,"date":"2017-05-28T12:31:45","date_gmt":"2017-05-28T12:31:45","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/create-custom-boxes\/"},"modified":"2017-05-28T12:32:24","modified_gmt":"2017-05-28T12:32:24","slug":"create-custom-boxes","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/create-custom-boxes\/","title":{"rendered":"Create Custom Boxes"},"content":{"rendered":"<p>I tried to create a custom grid box. I used the instructions from the <a href=\"http:\/\/doc.the-grid.ws\/dokumentation\/entwickler\/eigene-grid-boxen\/\" target=\"_blank\">german tutorial page<\/a>. I created a folder in the plugin directory named <em>grid-boxen<\/em> in this folder i have two files: <em>grid_boxes.php<\/em> and <em>grid_meine_box_box.inc<\/em><\/p>\n<p>I removed the dots (&#8220;&#8230;&#8221;) and also the empty arrays in <em>grid_boxes.php<\/em>.<br \/>\nI changed the variable1 to text like the <a href=\"http:\/\/doc.the-grid.ws\/dokumentation\/entwickler\/editor-widgets\/\" target=\"_blank\">description<\/a>.<\/p>\n<p>When I activate the plugin there is an fatal error:<br \/>\n<em>Fatal error: Class &#8216;grid_static_base_box&#8217; not found in<\/em> <\/p>\n<p>I also had a look into the <a href=\"https:\/\/github.com\/palasthotel\/grid\" target=\"_blank\">git repo<\/a>. There is written in usage:<br \/>\nWhatever you want to do, require grid.php and instantiate a new grid_library object.<br \/>\nThe grid_library object will provide you with everything you need to.<\/p>\n<p>So i added in the plugin these lines:<\/p>\n<pre><code>require_once plugin_dir_path(__FILE__).&#039;..\/grid\/lib\/grid.php&#039;;\nglobal $grid_lib;\n$grid_lib = new grid_library();<\/code><\/pre>\n<p>No there is a new fatal error:<br \/>\n<em>Fatal error: Cannot redeclare class grid_library in<\/em><\/p>\n<p>What should I do that it works?  <\/p>\n<p>By the way, in the german documentation is an writing error:<br \/>\n<strong>__contruct()<\/strong><br \/>\nIm Konstruktor muss&#8230; <\/p>\n<p>it should be:<br \/>\n<strong>__construct()<\/strong><br \/>\nIm Konstruktor muss&#8230;<\/p>\n","protected":false},"template":"","class_list":["post-9174194","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9174194","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":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9174194\/revisions"}],"predecessor-version":[{"id":9174197,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9174194\/revisions\/9174197"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=9174194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}