Skip to content

Using Shortcodes

Shortcodes let you drop dynamic DMS content into any page, post, or widget - no code required. Type the shortcode in square brackets and DMS replaces it with live content when the page loads.

Some shortcodes only work on a listing - a vehicle detail page (VDP) or inside a listing loop - because they need to know which listing to show. If one of those is placed on a normal page, it simply shows nothing. Each shortcode below notes where it works.

Placement tip: paste shortcodes into a normal text/HTML block. In Elementor, most of these are also available as visual elements - search "DMS" in the element panel.


Counts & Labels

[dms_get_total_listings]

Shows the total number of listings on your site. Works anywhere.

We currently have [dms_get_total_listings] vehicles in stock.

[dms_get_number_of_results]

Shows how many listings match a specific option (for example, how many Toyotas you have). Works anywhere.

Options: - term - the option to count (e.g. toyota). - type - which inventory type (e.g. vehicles). - singular / plural - words to show after the number.

[dms_get_number_of_results term="toyota" type="vehicles" singular="Toyota" plural="Toyotas"]
Shows something like "12 Toyotas".

[dms_get_singular_plural]

Shows your inventory's singular or plural label based on how many results are showing (e.g. "1 vehicle" vs "8 vehicles"). Use on a search results page.

Option: lowercase="true" to force lowercase.


On a Listing

These only work on a vehicle detail page or inside a listing loop.

[dms_get_listing_value]

Shows a specific field for the current listing - like exterior color or transmission.

Option: category - the field to show (its ID or name).

Color: [dms_get_listing_value category="exterior-color"]

[dms_get_meta_value]

Shows a raw stored value for the current listing, such as the VIN.

Option: meta - the stored field key.

VIN: [dms_get_meta_value meta="dms_vin"]

[dms_get_views]

Shows how many times the current listing has been viewed.

Option: type - unique (default) or total.

Viewed [dms_get_views] times

Pricing (Fees & Discounts)

All of these work on a listing and show money formatted with your currency settings. Add raw="1" to any of them to output just the number (no currency symbol) - handy inside other calculations.

[dms_final_price]

The price after all fees and discounts are applied.

[dms_fees_total]

The total of all fees added to the listing.

[dms_discounts_total]

The total of all discounts applied to the listing.

[dms_listing_fee] / [dms_listing_discount]

A single named fee or discount.

Options: - id - the fee/discount reference (required). - label="1" - show the fee's name before the amount (e.g. "Doc Fee: $499").

[dms_listing_fee id="doc-fee" label="1"]
[dms_listing_discount id="rebate"]

Troubleshooting

Nothing shows up. The shortcode is almost certainly an "on a listing" one placed on a page that isn't a vehicle detail page. Move it onto a listing template or VDP.

The raw text [dms_...] appears on the page. The shortcode name is misspelled, or the block is set to plain text/code. Retype it in a normal text block and check the spelling.

A price shows $0 or nothing. The listing has no price set, or that specific fee/ discount id doesn't exist on the listing.

For the technical reference (all attributes and behaviour), see the developer shortcodes reference.