Skip to content

Parent Field – how to build relation Make > Model e.g. BMW > M4

Link two Vehica taxonomy fields so the child only offers the options that belong to the selected parent — choose BMW as the Make and the Model list narrows to BMW models, both on the submit form and on every search form.

1 minute read

Below we build the relation for Make and Model — pick BMW as the make, and only BMW models remain selectable.

Taxonomy fields only
Both the parent and the child field have to be of the Taxonomy type.
Vehica Panel Custom Fields screen with the Add new field type dropdown open — Text, Number, Taxonomy, Price, Gallery, Embed, Date/Time, Heading, Location — and Taxonomy highlighted.

Point the child field at its parent

Edit the field that will be the child — in this example Model:

The custom fields table — Body Type, Condition, Year, Price, Offer Type, Make, Model, Drive Type — with the Model row outlined and an arrow pointing at its EDIT button.

Set the parent field, then save.

Settings of the Model field (field type: Taxonomy) with “Parent field (taxonomy only)” set to Make, above the SAVE CHANGES button.

Assign models to makes

Every option of the child field now carries a box for its parent. You can fill it in as you add the option:

WordPress admin menu with Vehicles expanded; the submenu lists Vehicles, Add New Vehicle, Body Type, Condition, Offer Type, Make, Model, Drive Type and more, with Model hovered.
The Model taxonomy screen with the Add New Model form: Name is 4-serie and, under Description, a Make box holds BMW, above the Add New Model button.

… or on an option you already have:

The Model taxonomy screen; on the right the term list shows 4-serie, 488 Spider, 6-serie, 7-serie and 718 Cayman with their makes, and the Edit / Quick Edit / Delete / View row actions are open under 7-serie.
Edit Model screen for 7-serie. The parent box under Description holds BMW — note that it is labelled “Model” on this screen — with the Update button below it.

How the relation behaves on the front end

Once makes and models are connected, the Submit Vehicle page in the front-end panel works like this:

Front-end Submit Vehicle form with Make set to BMW and the Model dropdown open, offering only BMW models: 4-serie, 6-serie, 7-serie, 8-serie, X1 and X7.

And on the search forms:

Homepage search form with BMW selected and the models dropdown open. 8-serie is highlighted with a count of (1); 4-serie, 6-serie, 7-serie, X1 and X7 are greyed out because no listing matches them.
Keep the child field locked until the parent is chosen
On every search form the child field has a Disable until parent field is not selected switch, so visitors have to pick a make before the model list opens.
The inventory search form in Elementor: in the left panel the Model field has “Disable until parent field is not selected” switched on, and the preview shows Make, Model, Drive Type and Fuel Type dropdowns above 12 results.