Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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',
); 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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