Extra Data Beyond the Editor
Every post and page has a title and a content area — but plenty of real content doesn't fit neatly into a paragraph. A star rating, a price, a due date, an author's job title. Custom fields (also called "meta") let you attach extra, structured pieces of data to any post, independent of the main content.
WordPress has supported basic custom fields since its earliest versions, but the default interface is a plain key-value box that's easy to mistype. Advanced Custom Fields (ACF) replaces that with a proper form builder.
- ✓Custom fields store data separately from the main post content.
- ✓ACF adds a visual field builder instead of raw key-value pairs.
- ✓Field groups can be limited to specific post types, pages, or templates.
What ACF Can Store
ACF ships with dozens of field types, but a handful cover most real-world needs.
Short labels or longer plain text — a job title, a short bio.
A dedicated image separate from the featured image — a logo, a headshot.
A rating, a price, or any value that should stay numeric.
A fixed list of choices — department, category, or status.
A repeatable group of fields — multiple team skills, multiple gallery items.
The default editor handles "what the page says." Custom fields handle "the structured facts about the page."
From Blank Group to Live Fields
Reading a Custom Field in a Template
// Inside a template file, inside the loop <?php $rating = get_field('star_rating'); ?> <p>Rating: <?php echo $rating; ?> / 5</p>
ACF's get_field() function pulls a saved value by its field name, ready to print anywhere in a template.
Do You Need the Paid Version?
Common Custom Field Mistakes
Breaking Down What You Just Learned
Custom fields store structured dataExtra facts about a post, separate from the main content area.
ACF replaces raw meta boxesA visual field builder instead of manually typed key-value pairs.
Location rules control where fields appearA field group can target a specific post type, page, or template.
get_field() displays valuesTemplates pull saved data by field name to print it anywhere on the page.
Free vs ProRepeater and Flexible Content fields require the paid version; single-value fields don't.
Try It Yourself
Create a field group with a Number field called "star_rating" and a Text field called "client_name," scoped to your Testimonial post type. Fill both in on an existing entry.
Add Structured Data to Your Capstone Site
Giving your custom post type real, structured fields
By the end of today, the custom post type from Day 19 should display at least one custom field value on the front end.
- Install Advanced Custom Fields.
- Create a field group with at least two fields relevant to your post type.
- Scope the field group's location rule to that post type only.
- Fill in the fields on your existing entries.
- If comfortable with template code, print one field value using
get_field().
Recap
A piece of structured data attached to a post, separate from the main content.
A set of related fields, scoped to specific post types or templates.
The condition that decides where a field group appears in the admin.
The function templates use to read and display a saved field value.
Key Takeaways
- Custom fields attach structured data to a post beyond its title and main content.
- ACF replaces WordPress's raw meta box with a visual field builder.
- Location rules keep field groups scoped to the post types or templates that actually need them.
- Templates read saved values with
get_field()to display them anywhere on the page. - Repeater and Flexible Content fields require ACF Pro; single-value fields work in the free version.