Skip to content
themeforge
EN
Start free
Menu
  1. Home
  2. Attribute reference
  3. opt-text
Core Site settings

A phone, address or slogan on every page

opt-text="Field name"

A text the client edits once for the whole site: in the header, the footer, a contact block. It lives in the site settings, not on a page.

Where it goes

First on theme-options.html, the page of site settings in your export, which has its own wp-fields-group. That is where the field is created.

Then anywhere on the site with the same name: in the header, the footer, on any page. There opt-text only reads the value.

The field appears in the admin only if the page has a group name: wp-fields-group on its <body>.

Example: the phone in the header

Markup theme-options.html · index.html
<!-- theme-options.html -->
<body wp-fields-group="Site settings">
  <span opt-text="Phone">+1 (555) 010-0199</span>
</body>

<!-- the header of every page -->
<span class="phone" opt-text="Phone">+1 (555) 010-0199</span>
In the admin ThemeForge → Options
Phone +1 (555) 010-0199
On the site every page
Home Menu Contacts
Call us +1 (555) 010-0199

What matters

  • Without theme-options.html the field is never created: the header prints an empty line.
  • The client edits it in ThemeForge → Options. One value for every page.
  • Same name everywhere: opt-text="Phone" in the header reads opt-text="Phone" from the settings.

Common mistakes

The build log is the “Logs” tab of your project on themeforge.pro; the free markup check shows the same notes.

Not like this
<!-- index.html only, no theme-options.html -->
<span opt-text="Phone">+1 (555) 010-0199</span>

Only on index.html: the field is never created, the header prints nothing, and the log is silent.

Like this
<!-- theme-options.html -->
<body wp-fields-group="Site settings">
  <span opt-text="Phone">+1 (555) 010-0199</span>
</body>

Declared on theme-options.html, read anywhere.

Alternative spelling

o_text works the same: the build gives an identical theme.

Used in recipes

Ready when you are

See your site’s WordPress admin before you pay.