Fields, Where to start

If you've just installed Fields, you might be left confusing on where to start. This page will guide you to create a sample box and include it in your write panels for your posts and pages.

We are going to create a box named Menu which has 2 groups: Details and More. 'More' has no fields while Details has 3 fields called Name, Price and Quality.

Step 1 - Create groups

After you're in the Setting → Fields page, click on Groups

and create a new group called Details just like figure below:

This should looks like what's on your screen:

Create another group called More then click on the Edit link of Details to edit the group

Step 2 - Create fields

Create a field named Name and leave the options as default:

Create a field named Price, make sure you tick the Multiple values option, this option will allow you to input multiple values into your fields. The Order option is not compulsory.

Now, the last field, Quality. In the Type options, select Drop box and enter "Normal, Premium, *Luxury" into the Values box (without the quotes). The star (*) infront of Luxury will make it the default checked item.

This should looks like what's on your screen:

Step 3 - Create the Menu box

Click on Boxes on the top menu to enter the boxes manage page.

Create a new box named Menu, make sure you have Details ticked in the Included Groups section. Tick the page item in the Supported post types section. Save it.

Note: the items thing in the supported types section is a custom post type I've created, it's probably not in your WordPress blog.

Step 4 - Show it all

That's all the configuration needed at the back, now we're going to work on the front.

Create a new page (Pages → Add New). There should be now a box called Menu in the write panel you're having:

Enter new data into the Menu box just like the above figure.

If you've noticed, the weird looking text beside the coffee glass in the post content box is what we call shortcode. These code allow you to display your custom fields on your posts and pages.

Copy and paste this into your content box:

Today's item is [field key='name'], it is of [field key='quality'] quality and is available in [field_count key='price'] prices: [field key='price' single='no' last_separator=' and '].

Update your page and view it.

For more information on how to display your fields in posts, please refer to the Show The Fields page

Leave a comment