Custom Post Box

Posted on  by 



Custom Post Box

Each UpTown Box box body is made out of aluminum, powder-coated with marine-grade paint, with custom colored doors and number backings. Each box has custom laser cut address numbers on the sides, with a laser engraved street address on the front door.POLE, LOCK and LIGHT-KIT not included, see TedStuff store. Buy Pro Box Layout for WPBakery Page Builder: Displaying Post & Custom Post in a News & Magazine Style by proword on CodeCanyon. Pro Box Style for Visual Composer.

Contents

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.

Australia post custom boxes

Meta Box Arguments:

  1. 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
  2. Post Type (required) – What Post Type the Meta Box should be attached to
  3. Repeater – Whether the Meta Box is a Single Custom Meta Box or Repeater Custom Meta Box. By default it is a Single Meta Box
  4. Sortable – Whether the entries are sortable or not. This is valid for Repeater Meta Boxes
  5. Post ID – ID of the post on which the Meta Box should appear
  6. 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.

The right way to add custom post meta box in WordPress post or page editor, add custom post meta easily with PHP example, simple way.

How To Add Custom Post Meta

Using add_meta_box() function and add_meta_boxes action we will add custom post meta, also we will use save_post action to save custom post meta data, and using get_post_meta() function we will get custom post meta value.

Custom Post Meta Example

Copy code and paste it in your “functions.php” file:

Custom Made Post Box

Note: custom post meta box will be display in “Post” editor, to display it in “Page” editor, change $screen value to “page”.

Box

Get Custom Post Meta Value

Australia Post Custom Boxes

Now to get your custom post meta value, use this code in anyplace of theme:

Custom Post Stamps

To get custom post meta value as “Shortcode”, use this function:

Custom Post Box Sizes

Now use this shortcode [custom_image_meta] to display value in posts.





Coments are closed