R
R
rowd2021-09-20 23:02:10
WordPress
rowd, 2021-09-20 23:02:10

How to display all posts from custom taxonomy?

There is a custom hierarchical taxonomy. Categories are created in it, a custom type of posts is stuck. Permalinks are configured /%category%/%postname%/. When I go to a link like /portfolio/categoryname, it correctly gives me all the posts in the category categoryname. But when I try to just go to /portfolio, I catch 404. How can I make all posts from the portfolio taxonomy and not an error be displayed at this address?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Zolin, 2021-09-21
@artzolin

You need to specify the argument when registering the post type 'has_archive' => true, it is responsible for creating the archive page of the post type

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question