Question

I am building a site in Wordpress were I have created 1 custom taxonomy named cars.

This taxonomy consists of several posts that work as follows:

  • if user goes in a page of the above taxonomy a list of cars as images is displayed.

  • by clicking to a car image he is forwarded to a new page with the list of images containing the specific car-model (brand).

My objective is to create 2 page templates as introduced by the template hierarchy:

taxonomy-cars.php
taxonomy-?.php

The first template will be named taxonomy-cars.php.
My problem is that I don't know how to name the second layer page template.

Was it helpful?

Solution

A taxonomy is composed of terms. I suppose in your case you have the cars taxonomy where the "brands" are one of the possible terms.

From the Template Hierarchy documentation:

taxonomy-{taxonomy}-{term}.php - If the taxonomy were sometax, and taxonomy's term were someterm WordPress would look for taxonomy-sometax-someterm.php.

So, try taxonomy-cars-ford.php.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top