You will find an example of a post with custom fields when you install b2evolution:
Defining custom fields
You can define custom fields in the Item Type form.
Custom fields can have different types: numbers (floating point numbers with double precision), text strings (varchars), URLs, text, etc.
Note about numbers: Although you could store numbers as text strings, storing them in number fields will make a difference when you try to sort posts based on the numbers stored here (numbers will sort as 1,2,3,9,10,11 whereas text strings would sort as 1,10,11,2,3,9)
You can define as many custom fields of each type as you want and give them a name each. Each custom field has a field index which can be generated from the field name. The field index is the trimmed lowercase value of the field name where the white spaces are converted to one single underline character. Field indexes must be unique in a blog ( this way field names are also unique ).
Sample field names and corresponding field indexes:
- ‘Color’ =>
- ‘Name of custom field’ =>
- ‘Max speed (km/h)’ =>
Entering data into custom fields
Displaying the data entered in custom fields
There are basically 3 ways to display custom fields:
Created by • Last edit by on Feb 10, 2019