0

My theme has a custom taxonomy template ("taxonomy-authors.php") but WordPress only serves this template file when a term associated with this taxonomy is called. e.g. example.com/cpt/authors/john-doe

When loading example.com/cpt/authors/ it will return a 404. What I want it to do is to list all terms associated with the taxonomy "authors" when example.com/cpt/authors/ is requested.

Here's part of my taxonomy-authors.php file:

<?php
    if (have_posts()) :
?>
        <h2>List of Authors</h2>

<?php
        $terms = get_terms('authors');

        foreach ($terms as $term) {
            echo $term->name;
        }

    endif;
?>

Any pointers on how to fix this?

1 Answer 1

0

There's no such thing as a taxonomy archive. There is a taxonomy term archive, but no taxonomy archive.

E.g. this URL makes no sense in the current system:

example.com/category/

But this does:

example.com/category/uncategorised/
2
  • Ah. I see. There's no way example.com/category can be utilised at all? Commented Jul 20, 2013 at 4:08
  • Yes, you can put a page with a page template there, but there's no such thing as a 'term archive' out of the box unless you code one yourself.
    – Tom J Nowell
    Commented Jul 21, 2013 at 22:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.