Dynamic strings are special placeholder tags that are automatically replaced with real-time, dynamic content when your site is displayed. This allows you to insert information like the current year, site name, or logged-in user’s name into text areas without manually updating them.
Available Dynamic Strings
Use the following placeholders in any supported text field. Simply type the placeholder exactly as shown (including the double curly braces), and the theme will replace it with the corresponding value on the front end.
| Dynamic String | Description | Example Output |
|---|---|---|
{{the_year}} | Displays the current year. Automatically updates each year — no manual changes needed. | 2026 |
{{the_date}} | Displays the current date using the date format set in Settings → General in your WordPress dashboard. | June 9, 2026 |
{{site_title}} | Displays your site’s name as configured in Settings → General → Site Title. | My Business |
{{theme_link}} | Outputs a link back to the theme page on WordPress.org. | Theme Name (linked) |
{{current_user}} | Displays the display name of the currently logged-in user. If no user is logged in, it will be empty. | John Doe |
Where Can I Use Dynamic Strings?
Dynamic strings can be used in the following areas of the theme, accessible via the WordPress Customizer (Appearance → Customize):
1. Top Bar — Text Widget
Navigate to Top Bar → Top Bar Widgets, add or edit a Text widget, and use dynamic strings in the Content field.
2. Copyright Bar — Text Widget
Navigate to Footer → Copyright Bar → Copyright Bar Widgets, add or edit a Text widget, and use dynamic strings in the Content field.
3. Pre Footer — Call to Action Content
Navigate to Footer → Pre Footer → Content, and use dynamic strings in the CTA text area.
Tip: Any text field in the Customizer that shows the message “Shortcodes and basic HTML elements allowed. See the list of available dynamic strings.” supports dynamic strings.
Allowed HTML Elements
In addition to dynamic strings, the supported text fields also accept basic HTML elements and WordPress shortcodes. You can use HTML to style your content — for example, adding links, bold text, or line breaks.
Supported HTML Tags
| Tag | Description | Example |
|---|---|---|
<a> | Hyperlink | <a href="https://example.com" target="_blank">Visit Us</a> |
<strong> | Bold text | <strong>Important</strong> |
<em> | Italic text | <em>Emphasized text</em> |
<b> | Bold text (alternate) | <b>Bold</b> |
<i> | Italic (or icon) | <i class="icon-class"></i> |
<br> | Line break | Line 1<br>Line 2 |
<span> | Inline container | <span class="highlight">Text</span> |
<img> | Image | <img src="image-url.jpg" alt="Description"> |
Supported Attributes
<a>—href,rel,target,class,role,id<img>—src,alt,width,height,class,id<span>—class<i>—class
Shortcode Support
All text fields that support dynamic strings also support WordPress shortcodes. Simply enter any valid shortcode directly in the text field, and it will be rendered on the front end.
Example:
[your-shortcode attribute="value"]
Examples
Here are some practical examples of how to use dynamic strings:
Auto-Updating Copyright Notice
© {{the_year}} {{site_title}}. All rights reserved.
Output: © 2026 My Business. All rights reserved.
This will automatically update to the new year every January — no manual edits required.
Copyright with Theme Credit
© {{the_year}} {{site_title}} | Powered by {{theme_link}}
Personalized Welcome Message (Top Bar)
Welcome, {{current_user}}! Today is {{the_date}}.
Output: Welcome, John Doe! Today is June 9, 2026.
Copyright with Custom Link
© {{the_year}} {{site_title}} | <a href="/privacy-policy/">Privacy Policy</a>
Output: © 2026 My Business | Privacy Policy
Combining HTML and Dynamic Strings
<strong>{{site_title}}</strong> — Est. 2020–{{the_year}}
Output: My Business — Est. 2020–2026
For Developers
Extending Dynamic Strings
You can add your own custom dynamic strings using the business_interface_parse_dynamic_strings filter. Add the following code to your child theme’s functions.php or a custom plugin:
phpadd_filter( 'business_interface_parse_dynamic_strings', 'my_custom_dynamic_strings' );function my_custom_dynamic_strings( $content ) { // Replace {{my_custom_tag}} with custom content. $content = str_replace( '{{my_custom_tag}}', 'My Custom Value', $content ); return $content;}
After adding the code above, you can use {{my_custom_tag}} in any text field that supports dynamic strings, and it will be replaced with “My Custom Value” on the front end.
Troubleshooting
Dynamic string not being replaced?
- Make sure the placeholder is typed exactly as shown, including the double curly braces
{{ }}with no extra spaces inside. - Verify you are using the dynamic string in a supported text field (Top Bar Text widget, Copyright Bar Text widget, or Pre Footer CTA content).
- Clear any caching plugin or browser cache after making changes.
{{current_user}} shows nothing?
- This placeholder only displays content when a user is logged in. For logged-out visitors, it will output an empty string. Consider wrapping it in a conditional message or using it only in areas visible to logged-in users.