PHPackages                             origgami/cmb2-grid - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. origgami/cmb2-grid

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

origgami/cmb2-grid
==================

889.7k↑16.7%22[15 issues](https://github.com/origgami/CMB2-grid/issues)1PHP

Since Dec 7Pushed 2y ago3 watchersCompare

[ Source](https://github.com/origgami/CMB2-grid)[ Packagist](https://packagist.org/packages/origgami/cmb2-grid)[ RSS](/packages/origgami-cmb2-grid/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (1)

CMB2-grid
=========

[](#cmb2-grid)

A grid system for Wordpress [CMB2](https://github.com/WebDevStudios/cmb2) library that allows the creation of columns for a better layout in the admin.

Installation
------------

[](#installation)

For now you have to install this as a WordPress plugin:

1. Download the plugin
2. Place the plugin folder in your `/wp-content/plugins/` directory
3. Activate the plugin in the Plugin dashboard

Usage
-----

[](#usage)

Create your cmb2 metabox like you always do:

```
$prefix = '_yourprefix_demo_';
$cmb = new_cmb2_box(array(
	'id'			 => $prefix . 'metabox',
	'title'			 => __('Test Metabox', 'cmb2'),
	'object_types'	 => array('page',), // Post type
));

$field1 = $cmb->add_field(array(
	'name'		 => __('Test Text', 'cmb2'),
	'desc'		 => __('field description (optional)', 'cmb2'),
	'id'		 => $prefix . 'text',
	'type'		 => 'text',
));

$field2 = $cmb->add_field(array(
	'name'		 => __('Test Text2', 'cmb2'),
	'desc'		 => __('field description2 (optional2)', 'cmb2'),
	'id'		 => $prefix . 'text2',
	'type'		 => 'text',
));
```

Now, create your columns like this:

```
if(!is_admin()){
	return;
}
$cmb2Grid = new \Cmb2Grid\Grid\Cmb2Grid($cmb);
$row = $cmb2Grid->addRow();
$row->addColumns(array($field1, $field2));
```

You can also use custom bootstrap column classes if you want, like this

```
$row->addColumns(array(
   array($field1, 'class' => 'col-md-8'),
   array($field2, 'class' => 'col-md-4')
));

```

**FAQ**

- It works on [group fields](https://github.com/origgami/CMB2-grid/wiki/Group-fields) also
- If you want, you can opt to use the metabox and the field IDs also.
- Currently the grid system is using a lite version of Twitter Bootstrap
- You can create as much rows as you want
- You have to put the fields in the columns in the same order they were created
- You can follow exactly what is in [Test/Test.php](https://github.com/origgami/CMB2-grid/blob/master/Test/Test.php) file to see it in action

Screenshots
-----------

[](#screenshots)

**This is what you get using columns**

[![Image](assets/imgs/screenshot1.jpg)](assets/imgs/screenshot1.jpg)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community24

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

Top contributor holds 69.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b4b75988e6d015150217b3b9730d2341eae639521e0d6de0578b48b94f35d11?d=identicon)[pablo.pacheco](/maintainers/pablo.pacheco)

---

Top Contributors

[![pablo-sg-pacheco](https://avatars.githubusercontent.com/u/8193404?v=4)](https://github.com/pablo-sg-pacheco "pablo-sg-pacheco (63 commits)")[![jrfnl](https://avatars.githubusercontent.com/u/663378?v=4)](https://github.com/jrfnl "jrfnl (15 commits)")[![jimboobrien](https://avatars.githubusercontent.com/u/4441256?v=4)](https://github.com/jimboobrien "jimboobrien (4 commits)")[![Mte90](https://avatars.githubusercontent.com/u/403283?v=4)](https://github.com/Mte90 "Mte90 (3 commits)")[![aydin41k](https://avatars.githubusercontent.com/u/17692306?v=4)](https://github.com/aydin41k "aydin41k (1 commits)")[![maarten00](https://avatars.githubusercontent.com/u/1579711?v=4)](https://github.com/maarten00 "maarten00 (1 commits)")[![MikeiLL](https://avatars.githubusercontent.com/u/6392263?v=4)](https://github.com/MikeiLL "MikeiLL (1 commits)")[![codiceovvio](https://avatars.githubusercontent.com/u/10262157?v=4)](https://github.com/codiceovvio "codiceovvio (1 commits)")[![belenski](https://avatars.githubusercontent.com/u/16647302?v=4)](https://github.com/belenski "belenski (1 commits)")[![jmarceli](https://avatars.githubusercontent.com/u/4281333?v=4)](https://github.com/jmarceli "jmarceli (1 commits)")

### Embed Badge

![Health badge](/badges/origgami-cmb2-grid/health.svg)

```
[![Health](https://phpackages.com/badges/origgami-cmb2-grid/health.svg)](https://phpackages.com/packages/origgami-cmb2-grid)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
