Support » Plugin: Grid » Create Custom Boxes

  • Resolved dariobaumberger

    (@dariobaumberger)


    I tried to create a custom grid box. I used the instructions from the german tutorial page. I created a folder in the plugin directory named grid-boxen in this folder i have two files: grid_boxes.php and grid_meine_box_box.inc

    I removed the dots (“…”) and also the empty arrays in grid_boxes.php.
    I changed the variable1 to text like the description.

    When I activate the plugin there is an fatal error:
    Fatal error: Class ‘grid_static_base_box’ not found in

    I also had a look into the git repo. There is written in usage:
    Whatever you want to do, require grid.php and instantiate a new grid_library object.
    The grid_library object will provide you with everything you need to.

    So i added in the plugin these lines:

    require_once plugin_dir_path(__FILE__).'../grid/lib/grid.php';
    global $grid_lib;
    $grid_lib = new grid_library();

    No there is a new fatal error:
    Fatal error: Cannot redeclare class grid_library in

    What should I do that it works?

    By the way, in the german documentation is an writing error:
    __contruct()
    Im Konstruktor muss…

    it should be:
    __construct()
    Im Konstruktor muss…

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author EdwardBock

    (@edwardbock)

    Hi @dariobaumberger,

    first of all thanks for the tip. I fixed the typo! 🙂

    Now to your technical problem:

    Did you install Grid with plugin installation to your WordPress or did you download the Grid WordPress Repo version of Github?

    Grid consists of two parts. The library part that is CMS independent and the CMS implementation. On WordPress.Org the Grid plugin is build with the library and should work just fine after installation. With the github version need a view extra steps.

    If you have the wordpress.org plugin version activated you should never have to manually include and initialize grid_library. There is an action for adding custom boxen named “grid_load_classes” that you should use in your plugin and include your custom_box.inc in the callback function. At this point all base box classes should be already loaded.

    You can find an example custom grid box plugin here: https://github.com/palasthotel/wp-grid-box-rss/

    I hope I could help. If not feel free to ask for more information.

    Now it works.

    Thank you for your support!

    Also i think the new description is better.

    Great plugin, thank you for sharing with us!

    Plugin Author EdwardBock

    (@edwardbock)

    Happy to help. Have fun with it 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Create Custom Boxes’ is closed to new replies.