I am using Wordpress 5.4. I created a CPT using the code below:
$args = array( 'labels' => $labels, 'description' => 'Some description', 'public' => true, 'menu_position' => 5, 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ), 'has_archive' => true, ); register_post_type( 'article', $args );
has_archive was set to true and my understanding is that now when I goto
/articles I am supposed to see all posts of type
article. But that is not the case. When I goto
/articles I see my normal posts. I do not have any
article-archive.php on my system and understand that is not necessary. I do have a
./wp-content/themes/twentynineteen/archive.php and I am using a child theme of
twnetynineteen on my site.
How can I fix this?
- I have tried
/articleand it does not fix the problem.
- I have tried resaving permalinks (Settings->Permalinks) and it does not fix the problem.
- The code above is located in a plugin.
- I can see my article if I goto
test-articleis slug of my article.
- I am using
nginxwith this configuration.