Custom fields attach to a post type and appear as inputs when editing a post of that type. Each field has a key, a label, and a type. The key is what you use in a template token: {field:my-key}. The label is what appears in the editor. The type controls the input and how the value is stored.
The 8 field types
Text produces a single-line input. Use it for titles, names, short labels, or any value that fits on one line.
Text area produces a multi-line input. Use it for descriptions, longer notes, or any value that spans more than one line.
Number produces a numeric input. The stored value is a number, not a string, so it sorts and filters correctly.
URL produces a text input validated as a URL. Use it for links, external references, or any value you will drop into an href attribute.
Date produces a date picker. The stored value is a date string in YYYY-MM-DD format.
Select produces a dropdown. You define the choices when you set up the field: a list of labels and values. The editor shows the labels; the template receives the value you defined.
Checkboxes produces a list of checkboxes. You define the choices the same way as a Select field. The stored value is the list of checked values, joined by commas when output in a template.
Image produces a media library picker. The stored value is an attachment ID. In a template, {field:my-key} outputs a ready image tag. For just the URL, use {field:my-key_url}.
Using a field in a template
Every field is available in the Post card, Single post, and Archive header templates for its type via {field:key}, where key is the field key you set when you created it. A field with the key roast-origin outputs as {field:roast-origin} anywhere in the template. If a post has no value for that field, the token outputs nothing rather than a placeholder.
Choices fields (Select and Checkboxes) output the stored value, not the display label. If you defined a choice with label “Light” and value “light”, the template receives “light”. That is usually what you want for class names and data attributes; if you want the label in the output, define the value to match the label.
For how to set up a type with fields and templates, see How to Create a Custom Post Type in WordPress Without PHP.