Site
Access global site settings. Available on all pages.
All Fields
| Field | Arguments | Returns | Description |
|---|---|---|---|
id | — | int | Site ID |
name | — | string | Site name |
description | — | string | Site tagline |
url | — | string | Site URL (home URL) |
home_url | — | string | Home URL |
site_url | — | string | WordPress installation URL |
admin_email | — | string | Administrator email (requires manage_options) |
language | — | string | Site language code (e.g. en_US) |
language_attributes | — | string | HTML lang="…" attribute string |
charset | — | string | Character set (UTF-8) |
multisite | — | bool | Is multisite network |
theme | — | array | Current theme info (name, slug, version, description, author, uri, parent_slug, parent) |
icon | — | Image | null | Site icon |
option | option_name | mixed | WordPress option value (allowlist-gated) |
Language attributes
The language_attributes field outputs the full lang="…" attribute (and direction on RTL sites), ready to drop into your <html> tag:
<html {{ site.language_attributes }}>
Theme
site.theme returns a flat array describing the active theme — name, version, description, author, URI, and parent (if any).
{{ site.theme.name }}
{{ site.theme.version }}
{{ site.theme.author }}
{{ site.theme.parent }} <!-- Parent theme info, if it's a child theme -->
Site Icon
The icon field returns an Image object, or null if no site icon is set.
{{ site.icon.src }}
{{ site.icon.src('thumbnail') }}
Options
site.option(name) reads a WordPress option, but only if the option name is on the allowlist:
{{ site.option('date_format') }}
{{ site.option('time_format') }}
{{ site.option('my_custom_option') }}
{{ site.option('theme_settings').colors.primary }}
Allowlist
Only date_format and time_format are allowed by default. Add more options via the unblock/data/allowed_options filter.
Common Patterns
Site branding
{{ site.name }}
{{ site.description }}
{{ site.icon.src('thumbnail') }}
Footer copyright
© {{ 'now'|date('Y') }} {{ site.name }}
Dynamic page title
{{ post.title }} - {{ site.name }}