custom post types – How to show CPTs in term archive

Question

I attached default taxonomy “category” to a “story” custom post type, when I register it:

  'show_in_rest' => true,
  'show_in_feed' => true,
  'taxonomies'   => ['category'],
  'has_archive'  => true,

Then, I try to show “story” posts with a category term using default template:

http://localhost:3000/category/my-term/

But the template only shows default posts instead CPT “story” AND default posts with that term.

How should the CPT “story” be included in the default wp_query in the term archive template?

0
aitor 2 months 2021-04-12T06:36:04-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse