I am building a new WordPress theme using register_post_type to create a custom post type called Listings.
I would like each listing to have the following permalink structure:
http://www.mysite.com/post-author/listing-title
I’m not quite sure how to achieve this with the CPT controls listed in the Codex. Any help or links would be greatly appreciated!
Actually, you’ll need to define your own custom URL rewrite rule to achieve this … it’s not a built-in feature of custom posts. There’s a good example in the Codex that will get you started.
Here’s a quick untested first-thought of how you could do this:
This should direct any links from
http://www.mysite.com/me/my-listingtohttp://www.mysite.com/index.php?author=me&listing-title=my-listing. Handling the query after WordPress gets ahold of it is entirely up to you.