I’ve been searching a way to have kind of “two” slugs for a custom post, let me give an example:
www.mywebsite.com/articles/ or www.mywebsite.com/articles/page/2/ for the archive
www.mywebsite.com/article/%post-name%/ for the single custom post
I’ve been searching a way to have kind of “two” slugs for a custom post, let me give an example:
www.mywebsite.com/articles/ or www.mywebsite.com/articles/page/2/ for the archive
www.mywebsite.com/article/%post-name%/ for the single custom post
Both of these are controlled by the arguments passed to register_post_type
, specifically, the rewrite
and has_archive
arguments:
$args = [
'rewrite' => ['slug' => 'article'],
'has_archive' => 'articles',
// the rest of your arguments...
]