0

I currently have:

mywebsite.com/custom-post-type-1/postname

mywebsite.com/custom-post-type-2/postname

I want to achieve:

mywebsite.com/my-base-slug/custom-post-type-1/postname

mywebsite.com/my-base-slug/custom-post-type-2/postname

I do not want "my-base-slug" to appear for anything other than those specified post-types.

Is that possible and how?

1

You can achieve this with the slug argument when you register your post type.

$args = array(
    'rewrite' => array( 'slug' => 'my-base-slug/custom-post-type-1' ),
    // your other args...
);
register_post_type( 'mycpt', $args );
0

If you are fine with using a plugin, just have a look at Custom Post Type Permalinks or Permalinks Customizer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.