Ok, so it might have been working all along, and I just hadn’t flushed the rewrites!
function my_dept_listing_init() {
//Easy flush
if (isset($_GET['flush'])) {
flush_rewrite_rules();
}
//endpoint onto which queries are made
add_rewrite_endpoint( 'individuals', EP_PAGES );
//This filter acts as a controller, inject into content
add_filter('the_content', 'my_dept_listing_content_ctrl');
}
add_action('init', 'my_dept_listing_init');
function my_dept_listing_content_ctrl($content) {
global $post;
$getName = get_query_var('individuals');
$post->post_title = $getName;
//Etc
}
Hope this helps someone!
Related Posts:
- Using the Rewrite API to Construct a RESTful URL
- Dynamic Endpoints
- How make a multi language routes, with rewrite rules or rewrite endpoints?
- Add rewrite rule for rewrite endpoint
- How to have multiple rewrite endpoints in the same URL?
- How to create an endpoint without creating sub endpoints?
- Removing “category” from URLs then “add_endpoint()” won’t work…
- URL endpoint with HTML
- Enpoint Not Found in Rewrite Tag Permalink
- Is it possible to create dynamic endpoint URLs?
- How to use a RewriteRule to change endpoint url
- wordpress url rewrite Query Var to Static url
- Adding rewrite endpoint breaks static front page
- Unique URL Every Time
- Rewrite default post type
- Rewrite Rules for Multiple (more than 2) Taxonomies
- How to add dot(“.”) in post slug
- 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
- custom template for custom url
- page is not redirecting
- Combine Multiple Categories Into One URL Slug
- Custom rewrite rule for backend/admin?
- add_rewrite_rule is not taking effect in WordPress? .htaccess file doesn’t update
- Author Profile URL
- Remove all categories from URL
- Add specific word to default page permalink
- Is it possible to generate an alternate structure for multi-tag urls?
- Use single-site install and map entities to subdomains
- 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
- How to define a callback for an URI?
- WordPress .htaccess blocks mine?
- My WP_options db rewrite_rules Does Not Work
- Rewrite Preview URL to include index.php
- Custom rewrite_rules – only pass numbers and not alphabetic characters
- How can I dynamically generate an image with a static image URL?
- Rewrite wp-login.php URLS to static pages?
- How to access custom pages
- How to create rewrite endpoints it in author.php?
- Changed pagination URLS to use p= instead of paged=
- React Router with WordPress
- joomla to wordpress migration and 404 errors issues [closed]
- How do I only allow downloads that are referred from my domain?
- URL rewriting with custom user meta “/%shop_name%/gallery/%gallery%”
- 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
- Retrieve query var within functions.php
- rewrite rule generated with mpdf to a shorter version
- Name page template properly
- WP in subfolder hidden by htaccess, but media links show the subfolder
- One off rewrite for single post-type slug (show normal page with same URL instead)
- WP redirect rule doesn’t work
- URL rewrite in theme doesn’t seem to be working
- .htm re-write is adding an ending / to my URL bar
- database not responding on localhost
- Rewrite rule that wp-login.php?action=register is left alone
- Trying to add array of paths to post permalink
- How to rewrite URL back to default custom URL if no destination found
- add_rewrite_rule refuses to function
- Append a parametter at first or last to a certain URL
- Creating a custom rewrite for a single page
- How to add logged in username after WordPress URL?
- Dynamic URL with rewrite rule not working
- How to get relative page for every post: /post-1/contact. /post-2/contact
- Passing a variable to hyperlink text?
- History API & URL for single long page
- Display categorised url
- Is it possible to rewrite a page URL from ID to name from an API?
- Dynamic URL Rewrite rule
- Root-relative paths being rewritten on ‘Edit Page’ [closed]
- ModRewrite not working properly
- Need help with custom rewrite rule
- WordPress doesn’t remember my custom rewrite rule
- Custom urls in WordPress involving page slugs
- Relative URL filtering
- how to change some of the rules in the database
- 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?
- How do I display a friendly URL link in the frontend?
- rewriting an Url
- WordPress Post url encoding problem
- Please give me the rewrite rules for my ugly urls
- Spurious URL structure (Adding extra /0/s)
- Programmatically add a custom url route “/category/index.json” to return a collection of posts in json
- WP-Include rewrite directory
- WordPress is adding pagination for all pages like www.example.com/page/123. How to remove that?