Custom fields

Custom fields

Register custom fields metabox and edit associated post type, options and fields.


Meta box options:
  • Meta box title: Title of the meta box with custom fields group.
  • Associated post type: Post type with which the meta box and custom fields should be associated. Only one meta box for post type is allowed.
  • Meta box context: The context within the screen where the box should display. Available contexts vary from screen to screen.
  • Meta box priority: The priority within the context where the box should show.

Custom field options:
  • Custom field label: Label of the custom field input in meta box.
  • Custom field key: Key name of the custom field, used to display the field value on the front end. Will be sanitized. It is recommended to use post type as a prefix. Add an underscore in first place to make this custom field private and not shown in the admin UI. Leave blank to generate from post type & label.
  • Type: Type of input for this custom field. Available tpes: Text, Textarea, Number, Date, Color, Image / File, Select option, Checkbox list.
  • Options list: Comma separated list of options for select and checkboxes custom field types. Option 1, Option 2, Option 3

On update:
Basic mode: New code will be generated to update the related PHP file. Related theme mod will be updated.
Advanced mode: Editor code will be used to update the related PHP file. Related theme mod will not be updated.

On reset:
No custom fields will be registered.
Related PHP file will reset to default template. Related theme mod will reset to default values.

Custom fields

Switch to advanced mode

Register custom fields metabox and edit associated post type, options and fields.


Meta box options:
  • Meta box title: Title of the meta box with custom fields group.
  • Associated post type: Post type with which the meta box and custom fields should be associated. Only one meta box for post type is allowed.
  • Meta box context: The context within the screen where the box should display. Available contexts vary from screen to screen.
  • Meta box priority: The priority within the context where the box should show.

Custom field options:
  • Custom field label: Label of the custom field input in meta box.
  • Custom field key: Key name of the custom field, used to display the field value on the front end. Will be sanitized. It is recommended to use post type as a prefix. Add an underscore in first place to make this custom field private and not shown in the admin UI. Leave blank to generate from post type & label.
  • Type: Type of input for this custom field. Available tpes: Text, Textarea, Number, Date, Color, Image / File, Select option, Checkbox list.
  • Options list: Comma separated list of options for select and checkboxes custom field types. Option 1, Option 2, Option 3

On update:
Basic mode: New code will be generated to update the related PHP file. Related theme mod will be updated.
Advanced mode: Editor code will be used to update the related PHP file. Related theme mod will not be updated.

On reset:
No custom fields will be registered.
Related PHP file will reset to default template. Related theme mod will reset to default values.

No custom fields meta box found.

Meta box associated to
with 0 custom fields.

No custom fields in meta box group

Delete
Delete

Custom fields

Switch to basic mode

Register custom fields metabox and edit associated post type, options and fields.


Meta box options:
  • Meta box title: Title of the meta box with custom fields group.
  • Associated post type: Post type with which the meta box and custom fields should be associated. Only one meta box for post type is allowed.
  • Meta box context: The context within the screen where the box should display. Available contexts vary from screen to screen.
  • Meta box priority: The priority within the context where the box should show.

Custom field options:
  • Custom field label: Label of the custom field input in meta box.
  • Custom field key: Key name of the custom field, used to display the field value on the front end. Will be sanitized. It is recommended to use post type as a prefix. Add an underscore in first place to make this custom field private and not shown in the admin UI. Leave blank to generate from post type & label.
  • Type: Type of input for this custom field. Available tpes: Text, Textarea, Number, Date, Color, Image / File, Select option, Checkbox list.
  • Options list: Comma separated list of options for select and checkboxes custom field types. Option 1, Option 2, Option 3

On update:
Basic mode: New code will be generated to update the related PHP file. Related theme mod will be updated.
Advanced mode: Editor code will be used to update the related PHP file. Related theme mod will not be updated.

On reset:
No custom fields will be registered.
Related PHP file will reset to default template. Related theme mod will reset to default values.
File:
PHP dct-custom-fields.php/custom/php/dct-custom-fields.php
PHP code used with developer: Custom fields.
Type: PHP
Size: 377 B
Modified: 2026/07/16 10:30:36
Toggle editor find & replace panel.
Hotkeys: CTRL + F to open, ESC to close
Copy editor contents to clipboard.
Toggle editor light/dark theme.

How to use custom fields

To display the custom fields for each post, you have to use a template tag that customizes your theme.
get_post_meta($post->ID, $field_key, true);

In visual builders, use dynamic content and custom field name to display the value.
Private custom fields (with field key starting with underscore) will not be shown in the admin UI and visual builders.