Skip to content

Quick Start

Create your first field group and display a custom field value in your theme in under 5 minutes.

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

  1. Go to OneMeta → Add New in your WordPress admin
  2. Enter a Field Group Key — use lowercase letters and underscores only, e.g. hero_fields
  3. Enter a Title — e.g. Hero Fields
  4. Set Type to Post/Page Meta
  5. Select the Post Type — e.g. Post

Step 2 — Add a Field

  1. Click Add Field or drag Text from the field palette sidebar
  2. Set the Field Key — e.g. hero_title
  3. Set the Label — e.g. Hero Title
  4. 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

  1. Go to Posts → Add New (or edit an existing post)
  2. Scroll down to find the Hero Fields meta box
  3. Enter a value in the Hero Title field
  4. 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?

On This Page