0

If I have a custom post type called Drink which has permalinks like /drink/pepsi/ then /drink/ will list all of the Drinks. How can I rewrite /drink/ to /drinks/?

I want permalinks for single Drinks /drink/pepsi to stay with the /drink/ root but I think /drinks/ makes better sense for the "archive" of Drink.

1 Answer 1

1

When you register your custom post type, set the has_archive argument to the slug you want for the archive page, in this case drinks:

$args = array(
    'rewrite' => array( 'slug' => 'drink' ),
    'has_archive' => 'drinks',
); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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