Documentation · Frontend Guide
Vehicle Archive
This document covers the vehicle archive page of the ADP Car Market Hub WordPress Plugin: how vehicles are listed, how filters and sorting work, and what visitors can do from the archive.
When to use this document
Read this document if you are configuring the vehicle archive for the first time, troubleshooting filter or sorting behavior, or helping a visitor understand how to search and browse the inventory.
Overview
The vehicle archive displays all imported vehicles as a browsable, filterable list. Visitors can narrow down results using search filters, sort the list by price or mileage, switch between grid and list views, and navigate to individual vehicle detail pages.
The archive is rendered by the plugin's built-in archive template (archive-as24ci_car.php). It can be displayed in two ways:
- Native CPT archive: WordPress automatically serves the archive at the custom post type archive URL. The plugin registers the
as24ci_carpost type and intercepts the archive template via thearchive_templatefilter. - Shortcode page: Place the
[as24ci_archive]shortcode on any WordPress page. The plugin renders the full archive including filters and pagination on that page. This is the recommended approach when using plain (non-pretty) permalinks or when you want to control the archive URL slug.
Both methods use the same template and produce identical output.
Requirements or prerequisites
- The plugin must be installed and activated.
- At least one vehicle must have been imported and published.
- If using the shortcode method, a page with
[as24ci_archive]must exist in WordPress. - The archive page or CPT archive URL must be publicly accessible.
Step-by-step instructions
Display the vehicle archive via shortcode
- In the WordPress admin, go to Pages → Add New.
- Give the page a title such as "Our Vehicles" or "Car Inventory".
- In the page content editor, add the shortcode
[as24ci_archive]. - Publish the page.
- In the plugin settings, confirm the archive page ID is set correctly under the plugin's configuration, so breadcrumbs and compare links point to the correct URL.
Pre-filter the archive using shortcode attributes
You can pre-filter the archive from the shortcode to show only a subset of vehicles:
[as24ci_archive make="bmw" fuel="diesel" per_page="12"]
Supported shortcode attributes:
| Attribute | Description | Example value |
|---|---|---|
make | Filter by make (slug) | bmw, volkswagen |
model | Filter by model (slug) | 3-series, golf |
price_min | Minimum price | 5000 |
price_max | Maximum price | 30000 |
fuel | Filter by fuel type (slug) | diesel, electric |
body | Filter by body type (slug) | suv, sedan |
order_by | Sort field: price, mileage, or date | price |
order | Sort direction: asc or desc | asc |
per_page | Results per page: 12, 24, 48, 72, or all | 24 |
Visitors can still interact with the filter form after the page loads. GET parameters from the filter form override shortcode attributes.
Configuration reference
Filter controls
The archive includes a search filter form. Which filters appear is controlled by the plugin's Layout Manager → Search Filters zone. The following filter fields are supported:
Standard filters (visible by default):
- Make
- Model (dependent on Make selection)
- Year (min/max range)
- Mileage (min/max range)
- Price (min/max range)
- Fuel type
- Transmission
- Drive type
- Condition
- Exterior color
Advanced filters (shown via a "Show More" toggle):
- Interior color
- Engine displacement (min/max range)
- Energy label
- Location
Optional filters (disabled by default, can be enabled):
- Body type
- Doors (min/max range)
- Seats (min/max range)
Toolbar controls (configurable):
- Sort order
- Results per page
- Keyword search (
q)
Each filter can be individually enabled or disabled in the Layout Manager. Disabled filters are hidden from visitors but do not affect any currently active filter values.
GET parameters accepted by the archive
The archive processes the following GET parameters, which the filter form submits automatically:
| Parameter | Type | Description |
|---|---|---|
make | string | Vehicle make slug |
model | string | Vehicle model slug |
body_type | string | Body type slug |
drive_type | string | Drive type slug |
condition | string | Condition slug (new or used) |
fuel_type | string | Fuel type slug |
transmission | string | Transmission slug |
color_exterior | string | Exterior color slug (color is accepted as alias) |
color_interior | string | Interior color slug |
min_price | int | Minimum price |
max_price | int | Maximum price |
mileage_min | int | Minimum mileage in km |
mileage_max | int | Maximum mileage in km |
year_min | int | Minimum registration year |
year_max | int | Maximum registration year |
displacement_min | int | Minimum engine displacement in cc |
displacement_max | int | Maximum engine displacement in cc |
energy_label | string | Energy label slug |
location | string | Location name |
doors_min | int | Minimum number of doors |
doors_max | int | Maximum number of doors |
seats_min | int | Minimum number of seats |
seats_max | int | Maximum number of seats |
status | string | all, new, or used (status tab) |
q | string | Keyword search (max 100 characters) |
sort | string | Sort order (see Sorting section) |
per_page | string | Results per page: 12, 24, 48, 72, or all |
paged | int | Page number for pagination |
Sorting
The archive supports the following sort options via the sort GET parameter:
| Value | Description |
|---|---|
| (empty) | Newest first (date descending) |
price_asc | Price: lowest first |
price_desc | Price: highest first |
mileage_asc | Mileage: lowest first |
mileage_desc | Mileage: highest first |
The default sort order can be configured in the plugin settings. If no default is configured, the archive defaults to newest first.
Layout and display options
The following display settings are available in the plugin admin:
| Setting | Options | Description |
|---|---|---|
| Archive layout | grid, list, both | Card display mode. both adds a view switcher button. |
| Grid columns | 1, 2, 3, 4 | Number of columns in grid view |
| Results per page | 12, 24, 48, 72, or custom integer | Default number of vehicles per page |
| List excerpt length | 0–500 characters | Character limit for the excerpt shown in list view |
| Badges | New, Used, Sale, Top offer | Toggle which badges are shown on vehicle cards |
Archive card content
Each vehicle card in the archive shows the following information. Individual elements can be reordered or disabled via the Layout Manager → Archive Cards zone:
- Vehicle thumbnail image (falls back to a placeholder if no image is available)
- Vehicle title
- Price (formatted with currency)
- Condition badges (New, Used, Sale, Top offer)
- Key facts: year, mileage, fuel type, transmission, horsepower, body type, exterior color, condition (configurable)
- Favorites button (heart icon, if favorites feature is enabled)
- Compare button (if compare feature is enabled)
- Excerpt text (list view only, if excerpt length is greater than zero)
Condition tabs
The archive header includes three tabs: All, New, and Used. Each tab shows the number of vehicles matching the current filter state. Clicking a tab filters by condition. When a condition is selected via the condition dropdown filter, the tab counts and tab selection are synchronized with that selection.
Operational notes
- Categorical filters (make, model, fuel type, condition, etc.) are implemented using WordPress taxonomy queries. Numeric filters (price, mileage, year, displacement) query the plugin's custom
{prefix}as24_vehiclesdatabase table. - Location filtering resolves the location name to a set of seller IDs and then filters vehicles by those sellers.
- When the
per_page=alloption is selected, pagination is hidden and all matching vehicles are returned in a single request. - The archive template is loaded via the WordPress
archive_templatefilter. The active theme can override the template by providing aarchive-as24ci_car.phpfile in the theme directory. - When using the shortcode, the form action points to the current page URL rather than the CPT archive URL. This ensures that filter submissions and pagination work correctly on the shortcode page.
- The plugin enqueues its own CSS and JavaScript only on archive pages, single vehicle pages, and pages that contain a recognized plugin shortcode.
Troubleshooting
The archive page shows no vehicles.
- Confirm that at least one vehicle has been imported and is published.
- Check that the correct page is configured as the archive page in the plugin settings.
- If using the CPT archive URL, verify that pretty permalinks are enabled in WordPress Settings → Permalinks.
Filters are not appearing.
- Check the Layout Manager → Search Filters zone and confirm the desired filters are enabled.
- If the filter form appears but a specific filter is missing, it may have been disabled in the Layout Manager.
Sorting by price or mileage is not working correctly.
- Price and mileage sorting relies on the plugin's custom vehicles table. Vehicles imported before this table was created may not sort correctly until they are re-imported or the migration tool is run.
The [as24ci_archive] shortcode is not rendering.
- Confirm the plugin is active and the shortcode is placed correctly in the page content.
- Check for theme or plugin conflicts that may suppress shortcode output.
Pagination does not work on a shortcode page.
- The
pagedandpageGET parameters are both supported. Verify your theme's pagination links generate one of these parameters.