Skip to main content

Site

Access global site settings. Available on all pages.

All Fields

FieldArgumentsReturnsDescription
idintSite ID
namestringSite name
descriptionstringSite tagline
urlstringSite URL (home URL)
home_urlstringHome URL
site_urlstringWordPress installation URL
admin_emailstringAdministrator email (requires manage_options)
languagestringSite language code (e.g. en_US)
language_attributesstringHTML lang="…" attribute string
charsetstringCharacter set (UTF-8)
multisiteboolIs multisite network
themearrayCurrent theme info (name, slug, version, description, author, uri, parent_slug, parent)
iconImage | nullSite icon
optionoption_namemixedWordPress 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') }}
© {{ 'now'|date('Y') }} {{ site.name }}

Dynamic page title

{{ post.title }} - {{ site.name }}