Dynamic Values

Dynamic values fetch and show data from a specific source. There are 3 types of dynamic values based on their source:

  • Global – values are specified site-wide and do not vary from page to page. Examples: site icon, site title, homepage URL, custom fields from the ACF Options page, etc.
  • Current page – values depend on the currently viewed page. Examples: post title, featured image, post taxonomy, custom field assigned to a page, etc.
  • Current Grid/List item – values depend on the post/page which corresponds to the Grid/List item. This is Zephyr specific, all those values can be used only via Grid Layouts. Examples: post title, featured image, post taxonomy, custom field, etc.

Text Dynamic Values #

Most options supporting dynamic values allow you to select them via the special popup. Click the "stack" icon on the right and see all available values.

Text Dynamic Values can be:

  • Site Title - shows the site title inside the text
  • Post Title - shows the post title inside the text
  • Post Type (singular/plural) - shows the singular/plural label of the current post type.
  • Comments Amount - shows the total number of comments for the current post.
  • ACF fields with the following types:
    • Text
    • Number
    • Range
    • Email
    • Date picker
    • Date & time picker
    • Time picker

Multiple Text Dynamic Values #

In case you need to use a dynamic value as a part of your text you can use special shorthands:

  • {{site_title}} – shows the site title from general settings
  • {{the_title}} – shows the current page title
  • {{current_id}} – shows the current post / term / user ID
  • {{post_type_singular}} – shows the name of the current post type (e.g. Post, Page, Movie, Video, Member)
  • {{post_type_plural}} – shows the name of the current post type in plural (e.g. Posts, Pages, Movies, Videos, Members)
  • {{comment_count}} – shows comments amount of the current post (or reviews amount of the current WooCommerce product)
  • {{post_count}} – shows the total amount of published posts
  • {{user_count}} – shows the total amount of registered users
  • {{favs_count}} – shows the amount of user's favorite posts
  • {{today}} – shows the current date in "Ymd" format. Useful in custom fields conditions
  • {{now}} – shows the current time in "His" format. Useful in custom fields conditions
  • {{today_now}} – shows the current date and time in "YmdHis" format. Useful in custom fields conditions
  • {{date|custom_format}} – shows the current date and time in the specified format. Examples:
    • {{date|Y}} – shows the current year
    • {{date|l}} – shows the current day of the week
    • {{date|H:i}} – shows the current time
  • {{custom_field_name}} – shows the value from a custom field of the current page (post, product, term, etc.). All HTML tags will be stripped, that's why it's not possible to output images and other complex content. If the custom field doesn't exist, then returns an empty string.
  • {{option|custom_field_name}} – shows the value from a custom field of the ACF Options page, if it exists.
  • {{user|field_name}} – shows the current user data. For non logged-in visitors shows an empty string. Examples:
    • {{user|first_name}} – shows a first name of the current user
    • {{user|user_email}} – shows an email of the current user
    • {{user|description}} – shows the "Biographical Info" text of the current user
    • {{user|custom_field_name}} – shows the value of the "custom_field_name" of the current user. You can assign custom fields for users via the ACF plugin.

Example with multiple dynamic values

The Real Estate demo has the following ACF fields:

2589.png

If you add the Text element with the following

{{storeys}}-storey house with living area of {{living_area}} sqm, with {{bedrooms}} bedrooms, located on a plot of {{land_area}} sqm.

text into the "House Page" Content template:

2590.png

After that, every house page will display values from its custom fields, like:

2591.png

Link Dynamic Values #

All link settings of theme elements allow to set a dynamic value via the special popup:

Link Dynamic Values can be:

  • Homepage – uses the link to the site front page
  • Clickable value (email, phone, website) – reads the element's label and converts it to the link if it contains the email, phone, or a URL
  • Post Link – uses the currently viewed post URL
  • Archive Page – uses the link to archive of the current taxonomy term
  • Open Image in a Popup – uses the link to the full size of the current image
  • Additional Settings: Custom Link – uses the value from the "Custom Link" field inside the "Additional Settings" block when editing a post (available for all post types)
  • Testimonial: Author Link – uses the value from the relevant option of the Testimonial post type
  • Author Archive – uses the archive link of all posts created by the current post author
  • User Website – uses the website URL of the current post author (if specified in their profile)
  • ACF fields with the following types:
    • Email
    • URL
    • Link
    • File
    • Page Link
    • Post Object

Image Dynamic Values #

All image settings of theme elements allow to set a dynamic value via the special popup:

Image Dynamic Values can be:

  • Site Icon
  • Featured Image
  • Additional Settings: Images – uses the image(s) specified in the "Images" field inside the "Additional Settings" block when editing a post (available for all post types)
  • ACF fields with the following types:
    • Image
    • Gallery

Color Dynamic Values #

All color pickers inside the theme elements allow to set a dynamic value via the dropdown list of variables:

Color dynamic values can be:

  • Colors from Theme Options > Colors
  • Additional Settings: Background & Text Color - colors from the "Additional Settings" block of the relevant post.
  • ACF Color Picker field - fetches the color assigned to the ACF Color Picker field of the relevant post.