Single Custom Meta Box Overview
A Single Meta Box allows you to add one or more Custom Fields to a specific Page, Post or Custom Post Type.
Creating a Single Custom Meta Box with Custom Fields
To create a Single Custom Meta Box with Custom Fields follow the steps below:
1. From the WCK plugin tab, click on Custom Fields Creator.
2. Click “Add New” to create a new Custom Meta Box for your Custom Fields.
3. Add a Custom Meta Box Title (e.g. Event Details) and fill in the Meta Box Arguments. For a Single Custom Meta Box make sure to leave Repeater set to false. When you’re done, go to Meta Box Fields to add your Fields.
Meta Box Arguments:
- Group name (required) – The name of the group. It is the name by which you will query the data in the front-end. Must be unique, only lowercase letters, no spaces and no special characters
- Post Type (required) – What Post Type the Meta Box should be attached to
- Repeater – Whether the Meta Box is a Single Custom Meta Box or Repeater Custom Meta Box. By default it is a Single Meta Box
- Sortable – Whether the entries are sortable or not. This is valid for Repeater Meta Boxes
- Post ID – ID of the post on which the Meta Box should appear
- Page Template – If post type is “page” you can further select a Page Template. The Meta Box will only appear on the page that has that selected Page Template.
4. After, under Meta Box Fields tab insert the Custom Fields, one entry at a time. Make sure you specify a Field Title and a Field Type for each Custom Field. After you are finished click on Add Entry.
Custom Fields Arguments:
- Field Title (required) – The title of the custom field
- Field Type (required) – The type of the custom field
- Description – The description of the field
- Required – Whether the field is required or not
- Default value – Default value of the field
5. Hit “Publish” and you’re done!
Now, under each “Event” Post Type, you’ll have the Meta Box appearing with all the Custom Fields you created.