I have a custom post type with a custom URL structure so it works like:


Now I have multiple authors of these posts, so I want to enable an "Author Archive" for only these custom post types at urls like this:


Is this possible? Any ideas?


UPDATE: @Milo points out (I believe correctly) that "WordPress wouldn't be able to discern what is a post title and what is an author name," so given that, how would I get URLs like http://domain.com/custom-post-type/author/authorname1 ? Thanks!

  • WordPress wouldn't be able to discern what is a post title and what is an author name. It would work if you gave it a unique prefix, like: http://domain.com/custom-post-type/author/authorname1 – Milo Jan 25 '13 at 3:49
  • Understood. How do you do that? (I'll modify the question ... ) – GavinR Jan 25 '13 at 4:15
  • See my answer below. – Milo Jan 25 '13 at 5:36

Change custom-post-type in the following to the name of your CPT, both the slug and post_type= in the query vars. Visit your Permalinks Settings page to flush rewrite rules. You could also put this in a plugin and flush rules on plugin activation.

function wpa83047_author_rewrite_rule(){
add_action( 'init', 'wpa83047_author_rewrite_rule' );

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.