Can I create permalinks like this: /%post_type%/%postname%/

I’ve been learning about custom post types from Morten Rand-Hendriksen’s great tutorial on making a WordPress portfolio theme on lynda.com. He demos how to set up a custom taxonomy for “recipes” and create links like domain.com/?recipes=post-title. I think this is really cool because you get a post-title with the contextual clue of “recipes” without being stuck with a bunch of nested hierarchical subdirectory archives that may be boring to look at and contain repetitious content.

For a large, multifaceted domain, I think it would be neat if there is a way to make a site behave as it has a permalink structure like this:
domain.com/%post_type%/%postname%/ for posts and custom post types, while staying with domain.com/page-name for pages.

Read More

I’m thinking of domain.com/blog/post-name for anything in the blog, though domain.com/?blog=post-title would still work.

What do you think, and what is the most practical way to go about this?

Related posts

Leave a Reply

1 comment

  1. When you’re registering a custom post type in WordPress, one of the arguments is ‘rewrite’, which allows you to set up a slug for your custom post type. In your example above, you would set the rewrite argument to 'rewrite' => array('slug' => 'recipes') to create a URL structure like http://example.com/recipes/general-tsos-chicken

    You can also add custom post types with a plugin like Custom Post Types UI. That plugin has a field in the advanced options for adding a rewrite slug.