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_car post type and intercepts the archive template via the archive_template filter.
  • 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

  1. In the WordPress admin, go to Pages → Add New.
  2. Give the page a title such as "Our Vehicles" or "Car Inventory".
  3. In the page content editor, add the shortcode [as24ci_archive].
  4. Publish the page.
  5. 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:

AttributeDescriptionExample value
makeFilter by make (slug)bmw, volkswagen
modelFilter by model (slug)3-series, golf
price_minMinimum price5000
price_maxMaximum price30000
fuelFilter by fuel type (slug)diesel, electric
bodyFilter by body type (slug)suv, sedan
order_bySort field: price, mileage, or dateprice
orderSort direction: asc or descasc
per_pageResults per page: 12, 24, 48, 72, or all24

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:

ParameterTypeDescription
makestringVehicle make slug
modelstringVehicle model slug
body_typestringBody type slug
drive_typestringDrive type slug
conditionstringCondition slug (new or used)
fuel_typestringFuel type slug
transmissionstringTransmission slug
color_exteriorstringExterior color slug (color is accepted as alias)
color_interiorstringInterior color slug
min_priceintMinimum price
max_priceintMaximum price
mileage_minintMinimum mileage in km
mileage_maxintMaximum mileage in km
year_minintMinimum registration year
year_maxintMaximum registration year
displacement_minintMinimum engine displacement in cc
displacement_maxintMaximum engine displacement in cc
energy_labelstringEnergy label slug
locationstringLocation name
doors_minintMinimum number of doors
doors_maxintMaximum number of doors
seats_minintMinimum number of seats
seats_maxintMaximum number of seats
statusstringall, new, or used (status tab)
qstringKeyword search (max 100 characters)
sortstringSort order (see Sorting section)
per_pagestringResults per page: 12, 24, 48, 72, or all
pagedintPage number for pagination

Sorting

The archive supports the following sort options via the sort GET parameter:

ValueDescription
(empty)Newest first (date descending)
price_ascPrice: lowest first
price_descPrice: highest first
mileage_ascMileage: lowest first
mileage_descMileage: 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:

SettingOptionsDescription
Archive layoutgrid, list, bothCard display mode. both adds a view switcher button.
Grid columns1, 2, 3, 4Number of columns in grid view
Results per page12, 24, 48, 72, or custom integerDefault number of vehicles per page
List excerpt length0–500 charactersCharacter limit for the excerpt shown in list view
BadgesNew, Used, Sale, Top offerToggle 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_vehicles database table.
  • Location filtering resolves the location name to a set of seller IDs and then filters vehicles by those sellers.
  • When the per_page=all option is selected, pagination is hidden and all matching vehicles are returned in a single request.
  • The archive template is loaded via the WordPress archive_template filter. The active theme can override the template by providing a archive-as24ci_car.php file 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 paged and page GET parameters are both supported. Verify your theme's pagination links generate one of these parameters.