Skip to content

Dynamic Variables

In this article

    Dynamic Variables allow you to add non-static text within elements or in certain theme settings. This feature makes it easy to create content that adapts automatically based on context, without having to manually update text for each page.

    For example, when building a dynamic template, you can use Dynamic Variables to display the page title along with the date in the format “Page Title – Published Date”. By adding them to a Heading element, the text will automatically update for each page, saving time and keeping your content consistent.

    List of Dynamic Variables

    Belo is a table showing the variables currently available in the theme and what they can be used to display.

    Variable nameReturn value
    {{icon__NAME}}Display a theme icon where NAME is the icon name or the SVG attachment ID.
    {{current_url}}Current URL.
    {{post_id}}Current post id.
    {{post_author}}Current post author name.
    {{post_date}}Current post publish date.
    {{post_modified}}Current post last modified date.
    {{post_title}}Current post title.
    {{post_slug}}Current post slug.
    {{post_rating}}Current post rating.
    {{post_content}}Current post content (formatted/parsed).
    {{post_excerpt}}Current post excerpt – returns the value of get_the_excerpt()
    {{permalink}}Current post url.
    {{title}}Current title (post or archives).
    {{taxonomy}}Current taxonomy name.
    {{term_name}}Current taxonomy term name.
    {{term_description}}Current taxonomy term description (formatted).
    {{term_id}}Current taxonomy term id.
    {{post_count}}Number of posts in current archive.
    {{category}}Current post primary category.
    {{primary_term_id}}Post primary term id.
    {{paged}}Paged text for paginated pages.
    {{acf_KEY}}ACF value where KEY is your acf field key or name.
    {{acf_option_KEY}}ACF Options Page value where the KEY is your acf field key or name.
    {{cf_KEY}}Custom field value where KEY is your custom field key.
    {{card_running_count}}Current running count number when used within custom cards.
    {{card_icon}}Icon defined under the Card Settings meta box.

    How to Add Custom Variables?

    The totaltheme/replace_vars/vars filter makes it possible to define custom replacement variables. This is helpful when a specific text string is used repeatedly throughout your site, as a single global variable allows for centralized updates.

    View the sample snippet here.

    Related Articles
    Back To Top