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_rewrite_rule(
'^custom-post-type/author/([^/]+)/?$',
'index.php?author_name=$matches[1]&post_type=custom-post-type',
'top'
);
}
add_action( 'init', 'wpa83047_author_rewrite_rule' );
Related Posts:
- Use a template file for a specific url without creating a page
- Using the Rewrite API to Construct a RESTful URL
- Adding rewrite endpoint breaks static front page
- Unique URL Every Time
- Rewrite default post type
- Rewrite Rules for Multiple (more than 2) Taxonomies
- add_rewrite_rule not loading correct page nor getting variables
- Using plus (+) sign instead of space (-) in WordPress URL
- Add language/country code to each possible URL
- Google is indexing wordpress attachment pages
- SEO Friendly URLs for my plugin categories
- How to create a specific frontend URL (not a Page) from a theme or plugin?
- WordPress URL rewrite regex
- WordPress keeps writing rewrite rules to .htaccess
- WordPress Rewrite
- page is not redirecting
- Combine Multiple Categories Into One URL Slug
- Multilingual theme: Changing locale based on URL
- Custom rewrite rule for backend/admin?
- Allow single quote in URLs
- add_rewrite_rule is not taking effect in WordPress? .htaccess file doesn’t update
- Author Profile URL
- Remove all categories from URL
- change default ‘post’ slug with register_post_type_args
- Add specific word to default page permalink
- Permalink Rewrite for Custom Taxonomy
- Removing “category” from URLs then “add_endpoint()” won’t work…
- Is it possible to generate an alternate structure for multi-tag urls?
- Use single-site install and map entities to subdomains
- Rewrite rule to load images from production does nothing
- Custom query_vars and parse_request on wp-admin
- WordPress SSL (https) is not working with custom permalink
- How do I change attachment slug from name to id
- Creating a dynamic URL structure
- NextGEN Gallery Lightbox – Social Share URL Redirect
- WordPress .htaccess blocks mine?
- My WP_options db rewrite_rules Does Not Work
- Rewrite Preview URL to include index.php
- How to disable URL rewriting for specific URLs?
- Custom rewrite_rules – only pass numbers and not alphabetic characters
- How to access custom pages
- How to create rewrite endpoints it in author.php?
- Rewrite custom post type URL parameters
- How to remove wordpress directory slash
- joomla to wordpress migration and 404 errors issues [closed]
- How do I only allow downloads that are referred from my domain?
- URLs with two taxonomies are missing from sitemap
- URL rewriting with custom user meta “/%shop_name%/gallery/%gallery%”
- URL Rewrite and add_query_var not working
- How to redirect a link to a new link?
- How to add custom rewrite rules and point to specific templates
- How to change custom post type slug
- ow to change cutsom page url of wordpress site using htaccess
- custom wordpress rewrite
- Keep requested/entered url with add_rewrite_rule
- Get wordpress installation folder
- Disable WordPress from changing URL slug when post is published
- Two sets of url one content?
- Rewrite Rule for homepage not working correctly
- Remove wp-admin from the URL
- WordPress .htaccess ignore path and subsequent .htaccess files in subfolders
- Adding Rewrite URL for Base + Children Separately
- Rewriting a date hierarchy into a ‘yyyy-mm-dd’ slug
- URL rewrite( I think? )
- custom url – add attachment’s id or name after post
- Help with WordPress custom url rewriting?
- Make the home page’s slug visible in the browser’s URL bar
- WordPress how to prevent URL encoding in URL of taxonomy terms
- loading images, css and fonts from site url
- dynamic URL rewrite
- How can I add a vanity URL for admin-ajax.php Calls?
- Remove part from dynamic url and redirect
- Rewrite rule can’t get the ID from rewrited
- How to Update / Change URL when Popup Modal Loads?
- How wordpress core include search.php with $_GET[‘s’]?
- Pretty URL via Rewrite
- Dynamic Content w/ geolocation in WP?
- WordPress numeric (yearly) page names / disable yearly archives
- Routing in WordPress
- url redirect none www to www
- Stop wordpress from prettify URL
- Moved WordPress to Subdirectory, still hijacking requests to files outside of its directory
- How to remove Base URL Duplication?
- Rewrite URL query string for all pages
- ModRewrite not working properly
- Need help with custom rewrite rule
- Relative URL filtering
- how to change some of the rules in the database
- Rewriting URLs with query strings and preserving them
- get_permalink is getting old rewrite rule
- Rewriting URL does not automatically log me in
- Custom Rewrite for Profiles
- Pagination posts. Url format
- how rewrite is working in wordpress
- How to prevent URL-modification when page title contains digits only?
- rewriting an Url
- WordPress Post url encoding problem
- Please give me the rewrite rules for my ugly urls
- Rewrite and replace url wp-admin/edit.php and wp-admin/post-new.php
- How can I add_rewrite_rule for a custom post type to preserve the referral id