This guide walks you through creating your first field group and displaying a field value in your theme. It takes about 5 minutes.
Step 1 — Create a Field Group
- Go to OneMeta → Add New in your WordPress admin
- Enter a Field Group Key — use lowercase letters and underscores only, e.g.
hero_fields - Enter a Title — e.g.
Hero Fields - Set Type to
Post/Page Meta - Select the Post Type — e.g.
Post
Step 2 — Add a Field
- Click Add Field or drag Text from the field palette sidebar
- Set the Field Key — e.g.
hero_title - Set the Label — e.g.
Hero Title - Optionally add a Description and Placeholder
You will see the live PHP code preview panel on the right update in real time.
Step 3 — Save the Field Group
Click Save Field Group. OneMeta stores your field group configuration and it is now active.
Step 4 — Enter a Value
- Go to Posts → Add New (or edit an existing post)
- Scroll down to find the Hero Fields meta box
- Enter a value in the Hero Title field
- Publish or update the post
Step 5 — Display the Value in Your Theme
Open your theme’s single.php (or whichever template applies) and use the onemeta_get_meta() helper function:
php
<?php
$hero_title = onemeta_get_meta( get_the_ID(), 'hero_title' );
if ( ! empty( $hero_title ) ) {
echo '<h1>' . esc_html( $hero_title ) . '</h1>';
}
?>
Important: Do not include the
onemeta_prefix in your field key — it is added automatically by the helper function.
What’s Next?
- Explore all Field Types to see what each one does and how to use it in your theme
- Learn about Repeater Fields for complex repeatable data
- Set up Conditional Logic to show and hide fields dynamically
- Export as PHP to use field groups without OneMeta installed