Grid Columns

Grid Columns was created because, frankly, I was tired of seeing theme developers add poorly coded shortcodes to their themes to handle this functionality. This plugin creates a [column] shortcode to address that issue.

Table of Contents

How to install the plugin

  1. Uzip the grid-columns.zip folder.
  2. Upload the grid-columns folder to your /wp-content/plugins directory.
  3. In your WordPress dashboard, head over to the Plugins section.
  4. Activate Grid Columns.

How does it work?

The plugin provides you with a shortcode called [column]. It allows you to create columnized content.

Some terms you should know

[column] shortcode arguments

The [column] shortcode that takes in several arguments. The default arguments are the following.

[column grid="4" span="1" push="0" class=""]...[/column]

Basic usage

Once you've installed and activated the plugin, using it is pretty simple. You only need to wrap the [column] shortcode around some content that you want to columnize. Of course, you can only use shortcodes in shortcode-ready areas such as the post content area.

Example #1

By default, Grid Columns is set up to display 4 columns. Suppose you wanted to split your content into 4 columns/sections. You'd do so like this:

[column]This is some very cool example content to use as an example.[/column]

[column]This is some very cool example content to use as an example.[/column]

[column]This is some very cool example content to use as an example.[/column]

[column]This is some very cool example content to use as an example.[/column]

That would output the following.

This is some very cool example content to use as an example.

This is some very cool example content to use as an example.

This is some very cool example content to use as an example.

This is some very cool example content to use as an example.

Example #2

Suppose you just wanted two columns. The following code would handle that.

[column grid="2" span="1"]This is some very cool example content to use as an example.[/column]

[column grid="2" span="1"]This is some very cool example content to use as an example.[/column]

That would output the following.

This is some very cool example content to use as an example.

This is some very cool example content to use as an example.

Example #3

Let's do something a little more advanced. Suppose you wanted a 4-section grid with the first column taking up the space of two sections. Your code would look like the following:

[column span="2"]This is some very cool example content to use as an example.[/column]

[column span="1"]This is some very cool example content to use as an example.[/column]

[column span="1"]This is some very cool example content to use as an example.[/column]

That would output the following.

This is some very cool example content to use as an example.

This is some very cool example content to use as an example.

This is some very cool example content to use as an example.

You probably noticed the span="1" and span="2" parts in the code. This represents the number of sections this particular column spans. So, if your grid is set up into 4 sections (default), you can only have a total span count of 4.

Example #4

Let's look at a slightly more advanced usage. Suppose you wanted a grid of 5 with first and last columns spanning 2/5 of the grid and the middle column spanning 1/5 of the grid. Your code would look like the following.

[column grid="5" span="2"]This is some very cool example content to use as an example.[/column]

[column grid="5" span="1"]This is some very cool example content to use as an example.[/column]

[column grid="5" span="2"]This is some very cool example content to use as an example.[/column]

That would output the following.

This is some very cool example content to use as an example.

This is some very cool example content to use as an example.

This is some very cool example content to use as an example.

Advanced usage

The following examples will just show you the code and output. You should understand the basic usage at this point.

Example #5

[column grid="5" span="2"]This is some very cool example content to use as an example.[/column]

[column grid="5" span="1"]This is some very cool example content to use as an example.[/column]

[column grid="5" push="1" span="1"]This is some very cool example content to use as an example.[/column]

This is some very cool example content to use as an example.

This is some very cool example content to use as an example.

This is some very cool example content to use as an example.

Example #6

[column grid="12" span="6"]This is some very cool example content to use as an example.[/column]

[column grid="12" span="2"]This is some very cool example content to use as an example.[/column]

[column grid="12" span="2"]This is some very cool example content to use as an example.[/column]

[column grid="12" span="2"]This is some very cool example content to use as an example.[/column]

This is some very cool example content to use as an example.

This is some very cool example content to use as an example.

This is some very cool example content to use as an example.

This is some very cool example content to use as an example.

Example #7

[column grid="3" span="1"]This is some very cool example content to use as an example.[/column]

[column grid="3" span="1" push="1"]This is some very cool example content to use as an example.[/column]

This is some very cool example content to use as an example.

This is some very cool example content to use as an example.

Frequently-asked questions

Help! My site's broken! What should I do?

Most likely, it's because you either have too many spans or not enough spans for your grid. Make sure each span argument for your [column] shortcode equals exactly the grid argument.

But, I did everything right.

If you're absolutely sure you're math is correct, it could be a conflict with your theme. It'd be impossible for me to know without seeing it in use on your site, so you'll either need to ask on my support forums or get your theme developer to help.

Can I have more than one set of grid columns in a post?

Yes. Absolutely. Just make sure each grid has the correct number of columns before starting a new one.

Can I nest columns?

No. This is a limitation of WordPress.

Can I use other shortcodes within the [column] shortcode?

Yes, you can. However, keep in mind, that I can't guarantee that your plugin developer knows what he's doing and created his shortcode correctly. But, yes, you can do this with properly-coded shortcodes.

Can I put content between two different column shortcodes?

It's possible, but you'll probably break something. I recommend against attempting this.

Plugin support

I run a WordPress community called Theme Hybrid, which is where I fully support all of my WordPress projects, including plugins. You can sign up for an account to get plugin support for a small yearly fee ($29 USD at the time of writing).

I know. I know. You might not want to pay for support, but just consider it a donation to the project. To continue making cool, GPL-licensed plugins and having the time to support them, I must pay the bills.

Grid Columns is licensed under the GNU General Public License, version 2 (or later).

This plugin is copyrighted to Justin Tadlock.

2012 © Justin Tadlock.