You want to use the add_rewrite_endpoint since what you are concerned with is at the end of the URL.
function wpseo331941_reader_endpoint() {
add_rewrite_endpoint('readers', EP_PERMALINK | EP_PAGES);
}
add_action('init', 'wpseo331941_reader_endpoint', 10, 0);
//When you want to check if the 'readers' is being used
if ( false !== get_query_var('readers', false) ){
//....
}
Note that the false !== has to be present, because your query var “readers” will have an empty string as its value.
Related Posts:
- Custom Post Type Permalink / Rewrite not working immediately
- Best way to flush_rewrite_rules for custom post type, in a mu-plugins plugin?
- Multiple post types – share same ReWrite slug?
- add_rewrite_endpoint() not working for custom post type archives
- How to modify URL structures in custom post types and taxonomies or terms
- Modify custom post type rewrite rules in a separate function
- Change page /2 to /transcript with a Rewrite
- Using %postname% tag with a Custom Permastruct creates 400 Bad Request Errors from the server
- WordPress Custom Post Type Category Page
- Permalink rewrite with custom post type and custom taxonomy
- Priority for Categories, Tags, Taxonomies, Posts, Pages and Custom Posts with same url
- wrong template for page of archive
- WordPress Rewrite rule for nested post types
- Add hierarchical taxonomy to permalink for custom post type
- How to Combine Two Custom Post Types into Single Permalink Structure
- How to rewrite custom post type with custom taxonomy urls?
- How much control do we have over CPT rewrite slugs? Can I create a “root” page for my CPT with out the page path, and then have paths for other pages?
- Custom rewrite rule for hierarchical custom post type
- Rewrite and custom post type: order by custom field not working
- Rewrite slug of custom post type to include post-id
- How to change custom post type permalink structure
- Front custom edit post page for each post
- How can I use get_post_meta with add_rewrite_rule to build custom permalinks?
- Adding Post id to the end of slug in a Custom Post Type
- Rewrite Question Mark in Post Template to Make it Pretty URL
- Custom taxonomy rewrite with query var returns %2F in URL
- cpt and page sharing same base permalink
- CPT Template Not Showing – Getting 404
- How to get list of taxonomy slugs ordered parents>childs?
- Rewrite Endpoints and CPTs – How to use in a plugin
- Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)
- Rewrite rule for Custom post type Monthly and Yearly archive
- Different rewrite rules for taxonomies and cp in multisite?
- Add a permalink variable onto custom post type URL after post name slug
- How to add custom taxonomy in custom post type permalink?
- Add parent post to Custom Post Type [closed]
- How to query 2 custom post types that need to share a slug?
- Custom rewrite to fetch feed data
- Custom Permalinks for Custom Post Types
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- SEO Concerns With Rewrite Rules
- Set parent for custom post type archive rewrite url
- Route subpage to Custom Post Type
- Rewrite permalink for multiple post types (CPT) with taxonomy term
- WordPress custom permalink and archive link for custom post type
- Pagination for custom post types – url rewriting
- Custom Post Type with modified permalink structure results in 404
- Modifying rewrite rules to use /category//
- Custom Endpoint For Custom Post Type from Child Theme
- WordPress custom taxonomy page
- Custom Post Type Date Based Archive URL rewrite [duplicate]
- Pages not appearing?
- Remove cpt slug from url and use custom taxonomy instead breaks all other cpt
- multiple URLS for the same page
- How to properly set the rewrite rules for this case?
- Category permalinks don’t work even after flushing
- How to fix 404 on post after prepending Custom Post Type url with Custom Taxonomy Term slug
- Custom Post Type parent/child relationship rewrite rules for permalinks
- Redirect Custom Post Type from Child Taxonomies
- Rewrite URL of Specific Post of Custom Type
- The page or ad listing you are trying to reach no longer exists or has expired
- How to build overlapping custom post_type and taxonomy rewrites without conflicts?
- Custom post type rewrite and wp_pagenavi interfering with each other
- Template hierarchy changes when custom post-type permalink leverages custom taxonomy
- Associate custom CPT with another CPT’s taxonomy and rewrite permalinks
- Custom Post Type Rewrite – Page Not Found
- Custom Post Type rewrite url to /category/pagetitle [duplicate]
- WordPress custom post type rewrite rule matches all pages returning 404
- page not found for example.com/custom-post-name
- Paging not working for hierarchical custom post type
- Rewrite for custom type and custom taxonomy
- redirect old post type url to new structure url
- Multiple Custom Post Type permalink issue
- Custom Post Types and rewrite rules – One CPT works and a cloned one doesn’t
- Archive page for a custom post type using WPML
- Why won’t this rewrite rule work?
- Permalink clashing with Custom Post Type rewrite rule
- CPT Template Not Showing – Getting 404
- How to rewrite CPT-Permalinks the correct way (incorporating meta-box-data)?
- Adding rewrite rules to Custom Post-type mixed with Taxonomy
- What is the proper way implement a global $wp_rewrite?
- rewrite rules add a folder in the path
- Display results from two Custom Post Types in page template
- Canonicalization + Custom Post Types not working as expected
- Ideal top-level slug methods
- Custom Taxonomy in Permalink from post type
- Custom post type permalink structure
- 404 Error On Custom Taxonomy Pages 2, 3, etc
- CPT Archive Pagination – Page not found
- How to add custom permalink struct with DYNAMIC author to a Custom Post Type
- Url rewrite with custom post type and taxonomy
- Paginate yearly archives for a custom post type
- Same slug for Custom Taxonomy archive and CPT archive – Rewrite rule not working
- What is the best way to relate different custom post types?
- Dynamic WordPress rewrite rules for multiple custom post types
- Need help creating a WordPress site that has a landing page and sub pages for an area (for example, “London”). Website will have 100’s of areas
- How to change rewrite slug for custom post type without conflicting w/ child pages of page with same slug
- Remove date rewrite rule for custom post type archive page
- Rewrite taxonomy permalink appended to CPT archive url
- Display content based on multiple URL parameters—pretty URL or query string