Our plugin for the mobile API comes with several shortcodes that you can use to display elements on your site. Currently these shortcodes are included in the plugin:
Vehicle Archive [car-archive]
You can use the shortcode [car-archive]
to display an archive with all your verhicles on any page. The shortcode already works without any additional attributes. You can use the shortcode as follows:
Archive with all vehicles
[car-archive]
Archive with vehicles of one (or more) category(s)
[car-archive category="limousine"]
[car-archive category="offroad,sports-car"]
Category ID herausfinden
The value for category must be one (or more) unique Slug(s) of a vehicle taxonomy that already exists. To find out the Slug of the category please go to the WordPress backend under
Cars > Car categories
and select the title form of the desired category here.
Archive with vehicles with specific postmeta
Each vehicle has multiple post meta entries as custom fields. The shortcode can be extended using these attributes to display specific vehicles.
Here’s an example to display all vehicles with alloy wheels:
[car-archive alloyWheels="1"]
Individual vehicles can also be displayed, for example using the unique ad ID from mobile:
[car-archive mobileAdId="435346362"]
It’s also possible to combine multiple attributes. Here’s an example to display all used electric vehicles:
[car-archive condition="USED" fuel="ELECTRICITY"]
Valid parameters for the condition
attribute are USED
or NEW
.
Valid parameters for the fuel
attribute are ELECTRICITY
, PETROL
, DIESEL
, LPG
, CNG
, HYBRID
or HYBRID_DIESEL
.
To find the parameters, simply open a vehicle in the backend. Under Custom Fields, you’ll see the possible attribute keys and values. Please always use the attribute keys without the mapi_
prefix.