Documentation · Frontend Guide
Shortcodes Reference
This document is a complete reference for all WordPress shortcodes provided by the ADP Car Market Hub WordPress Plugin.
When to use this document
Use this document when you need to embed plugin output on a WordPress page and want to know the exact shortcode syntax, supported attributes, and expected behavior for each shortcode.
Overview
The plugin registers the following shortcodes:
| Shortcode | Description |
|---|---|
[as24ci_archive] | Renders the full vehicle archive with filters, sorting, and pagination |
[as24ci_search_filter] | Renders the search filter form only, without results |
[as24ci_compare] | Renders the vehicle comparison table |
[as24ci_favorites] | Renders the visitor's saved favorites list |
[as24ci_location_box] | Renders the dealer location address box for a vehicle |
[as24ci_hours_box] | Renders the dealer opening hours box for a vehicle |
[as24ci_archive]
Renders the complete vehicle archive including the search filter form, results grid or list, condition tabs, sorting controls, per-page controls, and pagination. Produces the same output as the native custom post type archive URL.
Attributes
All attributes are optional. If a GET parameter with the same name is present in the URL, it overrides the shortcode attribute.
| Attribute | Type | Description | Example |
|---|---|---|---|
make | string | Pre-filter by vehicle make slug | bmw |
model | string | Pre-filter by vehicle model slug | 3-series |
price_min | int | Minimum price pre-filter | 5000 |
price_max | int | Maximum price pre-filter | 30000 |
fuel | string | Pre-filter by fuel type slug | diesel |
body | string | Pre-filter by body type slug | suv |
order_by | string | Sort field: price, mileage, or date | price |
order | string | Sort direction: asc or desc. Used with order_by. | asc |
per_page | string | Results per page: 12, 24, 48, 72, or all | 24 |
Examples
Render all vehicles:
[as24ci_archive]
Render only diesel SUVs sorted by price ascending:
[as24ci_archive fuel="diesel" body="suv" order_by="price" order="asc"]
Render vehicles in a price range with 12 results per page:
[as24ci_archive price_min="10000" price_max="50000" per_page="12"]
Notes
- Visitors can interact with the filter form after the page loads. Any filter selection by the visitor overrides the shortcode's pre-filter attributes via GET parameters.
- Pagination uses the
pagedorpageGET parameter. - The shortcode uses the page's own URL as the filter form action. Ensure the page has a clean, accessible URL.
[as24ci_search_filter]
Renders only the search filter form, without vehicle results. Use this on a homepage or landing page to let visitors set their criteria before being sent to the results page.
Attributes
| Attribute | Type | Description | Example |
|---|---|---|---|
results_url | string | URL of the results page the form submits to. Defaults to the CPT archive URL or /cars/. | /inventory/ |
Examples
Filter form that redirects to the default CPT archive:
[as24ci_search_filter]
Filter form that redirects to a custom results page:
[as24ci_search_filter results_url="/car-inventory/"]
Notes
- The filter form renders with the same fields and Layout Manager configuration as the archive page filter.
- Any GET parameters already present on the current page are reflected in the filter form's pre-selected values.
- When plain (non-pretty) permalinks are in use, the CPT archive URL may not be reachable. In that case, set
results_urlexplicitly to a page with the[as24ci_archive]shortcode.
[as24ci_compare]
Renders the vehicle comparison table. Loads the vehicle IDs from the ids GET parameter (a comma-separated list of post IDs) and displays each vehicle as a column in a side-by-side table.
Attributes
This shortcode has no configurable attributes. Vehicle IDs are passed via the URL.
URL format
/compare-page/?ids=123,456,789
The compare JavaScript builds this URL automatically when the visitor clicks the Compare button.
Example
[as24ci_compare]
Place this shortcode on a dedicated "Compare Vehicles" page. The plugin settings should reference this page's ID as the compare page.
Notes
- The compare table renders only published vehicles of the plugin's custom post type.
- A maximum of 4 vehicles is rendered regardless of how many IDs are passed. IDs beyond the first 4 are silently ignored.
- If no
idsparameter is present or all specified IDs are invalid, the page shows "No vehicles selected for comparison." - The fields shown in each column are configured in the Layout Manager → Compare zone.
[as24ci_favorites]
Renders the visitor's saved favorites list. The list is populated dynamically by JavaScript using vehicle IDs stored in the browser's localStorage. The plugin calls an internal REST endpoint to retrieve current vehicle data for each saved ID.
Attributes
This shortcode has no configurable attributes.
Example
[as24ci_favorites]
Place this shortcode on a dedicated "My Favorites" page.
Notes
- The page requires JavaScript to function. Without JavaScript, the list cannot be populated.
- If no vehicles are saved in the visitor's browser, the page shows "You have no saved favorites yet."
- The REST API must be publicly accessible. Security plugins that block public REST endpoints will prevent the favorites list from loading.
- The fields shown on each favorites card are configured in the Layout Manager → Favorites zone.
- Up to 50 saved vehicle IDs are retrieved per request.
[as24ci_location_box]
Renders the dealer location address box for a vehicle. The box shows the dealer name, phone, address, and optionally a "Visit Location" button if a website URL is configured.
The location is resolved by matching the vehicle's AutoScout24 seller ID against the plugin's configured locations.
Attributes
| Attribute | Type | Description | Example |
|---|---|---|---|
post_id | int | WordPress post ID of the vehicle. Defaults to the current post in the loop. | 456 |
Examples
Location box for a specific vehicle:
[as24ci_location_box post_id="456"]
Location box for the current post (when used inside a vehicle page template):
[as24ci_location_box]
Notes
- Returns empty output if the vehicle has no seller ID, or if no configured location matches the seller ID.
- On vehicle detail pages, this information is also rendered automatically below the contact form, so manual use of the shortcode on the same page would result in duplicate output.
[as24ci_hours_box]
Renders the dealer opening hours box for a vehicle. The box shows one column per configured hours category, each containing day range and time range rows.
The location is resolved by matching the vehicle's AutoScout24 seller ID against the plugin's configured locations.
Attributes
| Attribute | Type | Description | Example |
|---|---|---|---|
post_id | int | WordPress post ID of the vehicle. Defaults to the current post in the loop. | 456 |
Examples
Hours box for a specific vehicle:
[as24ci_hours_box post_id="456"]
Hours box for the current post:
[as24ci_hours_box]
Notes
- Returns empty output if the vehicle has no seller ID, no matching location is found, or the matched location has no opening hours configured.
- On vehicle detail pages, this information is also rendered automatically below the contact form.