TryDemo gives you three interchangeable ways to place a “Try Demo” request on your front end: shortcodes, Gutenberg blocks, and classic widgets. All of them render the same underlying form and respect the same settings.
Shortcodes
Each canonical shortcode has a legacy alias (in parentheses) kept for backward compatibility.
| Shortcode | Alias | Purpose |
|---|---|---|
[trydemo_try] | [try_demo] | Inline demo request form |
[trydemo_try_popup] | [try_demo_popup] | Button that opens the request form in a popup |
[trydemo_is_demo]…[/trydemo_is_demo] | [is_sandbox] | Show the wrapped content only inside demo sites |
[trydemo_is_not_demo]…[/trydemo_is_not_demo] | [is_not_sandbox] | Hide the wrapped content inside demo sites |
Request form attributes
Both [trydemo_try] and [trydemo_try_popup] accept these attributes:
| Attribute | Default | Description |
|---|---|---|
source_id | Main site ID | Blog ID of the template site to clone |
title | (empty) | Heading shown above the form / on the button |
label | Your email: | Label for the email field |
placeholder | example@mail.com | Placeholder for the email field |
submit_btn | Submit | Submit button text |
select_label | (empty) | Label for the source selector, when offering a choice of demos |
wrapper_class | (empty) | Extra CSS class on the form wrapper |
success | “An activation email was sent…” | Message shown after a successful request |
fail | “An error has occurred…” | Message shown on failure |
captcha | false | Force-render the reCAPTCHA widget for this form |
reCAPTCHA is also added automatically to every form when it is configured under General settings.
Examples
A basic inline form that clones site 2:
[trydemo_try source_id="2" title="Try the demo"]
A popup button with custom labels:
[trydemo_try_popup source_id="2" title="Launch live demo" submit_btn="Start my demo"]
Show a “You’re in a demo” banner only inside sandboxes:
[trydemo_is_demo]
You're exploring a live demo. It will expire soon — grab your copy!
[/trydemo_is_demo]
Hide a purchase prompt when the visitor is already inside a demo:
[trydemo_is_not_demo]
[trydemo_try source_id="2" title="Try before you buy"]
[/trydemo_is_not_demo]
Note: The request form is automatically hidden when viewed inside a demo site or when new demo registrations are disabled.
Gutenberg blocks
TryDemo registers four dynamic blocks under a dedicated TryDemo block category in the editor. They render through the same code as the shortcodes above.
| Block | Equivalent shortcode |
|---|---|
trydemo/try | [trydemo_try] |
trydemo/try-popup | [trydemo_try_popup] |
trydemo/is-demo | [trydemo_is_demo] |
trydemo/is-not-demo | [trydemo_is_not_demo] |
The Try and Try Popup blocks expose source_id and title as block attributes in the editor sidebar; source_id defaults to the main site ID. The Is Demo / Is Not Demo blocks wrap inner blocks and conditionally show them based on whether the current site is a demo.
Classic widgets
For themes and sidebars that use the classic Widgets system, TryDemo provides two widgets:
- TryDemo — the inline request form.
- TryDemo Popup — the popup request button.
Add them from Appearance → Widgets (on a source site) and configure the source template and title in the widget settings.
Which should I use?
- Building pages with the block editor → use the blocks.
- Working in classic content, page builders, or template files → use the shortcodes.
- Placing a demo button in a sidebar or footer widget area → use the widgets.
All three honor your settings identically, so mix and match freely.