[epl_matterport] Shortcode
The Matterport extension has two shortcodes: [epl_matterport] for the 3D tour and [epl_matterport_button] for the 3D View button. They're handy when you build listing templates with a page builder like Elementor, or want the tour somewhere the settings don't offer.
[epl_matterport]
On a single listing template, this shows that listing's tour:
[epl_matterport]
To show the tour of a particular listing anywhere on your site, add its ID:
[epl_matterport id="2222"]
Nothing is output when the listing has no tour, so it's safe to leave on every listing template.
Options
| Option | What it does | Default |
|---|---|---|
id |
The listing's post ID. You'll see it in the address bar when you edit the listing (post=2222). |
The current listing |
unique_id |
The listing's Unique ID, as entered or imported on the listing. Used when id isn't set. Published listings only. |
(none) |
height |
The tour height. Use a number with px, % or vh, for example 600px or 80vh. |
The Height setting on the 3D View tab (500px) |
first_only |
yes shows only the first tour. no shows every tour on the listing, one under the other. |
yes |
Examples
[epl_matterport unique_id="ab1234aj"] [epl_matterport height="80vh"] [epl_matterport first_only="no"]
In a PHP template file:
<?php echo do_shortcode( '[epl_matterport]' ); ?>
[epl_matterport_button]
Shows the 3D View button for the current listing, where you place it. One button per tour. The label, and whether it scrolls or opens a lightbox, come from the Button tab of the Matterport Settings.
[epl_matterport_button]
The button scrolls to, or opens, the tour on the same page. If you place the button with the shortcode, make sure the tour is on the page too, using the 3D View settings or [epl_matterport].
To show a "3D Tour" heading only when there's a tour, see Template functions.