Which of the following options is the correct order (by priority in use) to display tag in template hierarchy?
- tag-[slug].php, tag.php, tag-{id}.php, archive.php, index.php
- tag-{slug}.php, tag-{id}.php, tag.php, archive.php, index.php
- archive.php, index.php, tag-[slug].php, tag-{id}.php, tag.php
- tag-{id}.php, tag-[slug].php, tag.php, archive.php, index.php
Discussion
To display a tag archive index page, WordPress uses the following path:
- tag-{slug}.php – If the tag’s slug is sometag, WordPress will look for tag-sometag.php.
- tag-{id}.php – If the tag’s ID is 6, WordPress will look for tag-6.php.
- tag.php
- archive.php
- index.php