T
T
Theory Theory2021-06-08 09:19:00
WordPress
Theory Theory, 2021-06-08 09:19:00

How to create your own archive in wordpress?

Created category - Created archive-our_work.php When I go to localhost/our_work page not found register_taxonomy( 'our_work', [ 'our_work' ], [

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Gorbunov, 2021-06-08
@irtek

The concept of archive refers to post_type. You get the archive if you register your post type via register_post_type with the ['has_archive' => true] parameter, in which case the archive-works.php template will be included if the post_type is called 'works' and opens at /works.
For taxonomy, you can create a template taxonomy-our_work.php, which will be displayed at /our_work, in this template you can display posts with the terms you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question