You can achieve this via the Rewrite API‘s add_rewrite_endpoint
:
function wpa89344_add_presentation_endpoint(){
add_rewrite_endpoint( 'presentation', EP_PERMALINK );
}
add_action('init', 'wpa89344_add_presentation_endpoint');
Then in your template or wherever you differentiate a presentation vs normal view, check the global $wp_query
for the presence of the presentation
query var:
global $wp_query;
if( isset( $wp_query->query_vars['presentation'] ) ){
include(TEMPLATEPATH . "/single_wide_report.php");
} else {
include(TEMPLATEPATH . "/single_normal_report.php");
}
Note that you need to visit the permalinks settings page after adding the endpoint to flush permalinks and create the new rewrite rules.
EDIT- Output of $wp_query
in single.php
:
Related Posts:
- 404 Page Not Found for Only One Post
- 404 error on published page with specific permalink
- permalink to single page
- “post-name” Renders Using page.php, but “post-name-2” renders with single.php
- Why is “/page/2/” not working?
- How does WordPress handle permalinks?
- Get page permalink without wpurl
- Can I use REST-API on plain permalink format?
- How to change ‘with_front” key from an existing custom post type?
- Why would Numeric permalinks work, but %postname% won’t?
- Passing variables through permalink structure
- Make post slug have priority over category slug
- Adding anchor to paginate_links + Safari anchor bug
- How to stop permalink redirects for a particular slug
- Remove subfolders from URL
- Why does WP not use relative links when linking pages?
- htaccess or redirect to cloak portion of a link?
- What is the action or filter for changing permalink in Edit Post/Page?
- generate custom permalink based on a custom field
- WordPress Links Not Working After Migration
- Migrating WordPress blog to New Webhosts, something is adding a # and gibberish
- How to get wordpress link to fully evaluate when coming from facebook
- Is using %postname% for permalinks really that bad for performance?
- Adding File Extensions to Attachment Page Permalinks
- Change author slug and functionality
- How to tranform Headlines into linkable permalinks?
- Best way to add internal link in widget
- Changing search URL to something other than “search”
- Changes to .htaccess not updating the file (old rules still take effect)
- article pages not displaying on local instance of wordpress site
- breadcrumbs & rel=”nofollow”
- Use Regular Expression to get tag from permalink url during wp_rewrite in generate_rewrite_rules
- Create unique alphanumeric ID on wp_insert_post
- Programatically changing post’s permalink when identical post type is published
- Permalinks not working with Vagrant
- filtering special chars from post slug
- Default setting permalink /blog/
- How to change old permalink?
- Need help getting my Permalink structure right
- Losing preview ability: W3 Total Cache + Post name permalinks
- Get the url of a page template without using the page slug and ID
- How to show permalink auto when type text in post tiltle?
- Accessing Subdirectories in WordPress Install
- Broken Link in WP Site?
- How to change “attachment_id” in attachment permarlink?
- How to use different domains for different blogs hosted in the same host in subdomains with .htaccess
- Custom permalinks in WordPress
- Permalink opens attachment instead of page
- How do I get thumbnail generator to recognize the_permalink tag?
- Changing WordPress routing to load the same page for different URLs
- Custom post type clean shortlink
- cannot link a external url, present page url acting as parent url
- Exclude single page from permalink rule
- the_content(); erroneously closing off previous opening before it
- Bulk append URL (add word to slug)
- Image URL and size
- Conditional Permalink based on category?
- Permalink Custom Page Template
- defining child page permalink
- permalink error when modifying sanitize_title_with_dashes function
- Browsing to permalink prefix results in 404
- Shortcodes not working
- replicate url permalink after migrating to wordpress
- I need to change the attribute of the isPermaLink guid in the WordPress RSS feed – from false to true
- Shortlinks work only for logged in users
- Changing permalink for blog posts, current structure www.website.com/blog-post, change to, www.website.com/blog/blog-post
- Does wordpress take care of slug collisions?
- WordPress permalink not working on subdomain
- Fatal Error when trying to load Permalinks page on WP admin [closed]
- How to construct a dynamic rewrite rule for child pages that passes more than one query var
- Cannot publish posts or pages when I change permalink structure
- Add /blog prefix for all WordPress front end url
- Permalink structure has suddenly changed
- How to experiment with permalink structure on a select number of posts
- In a multisite, how can I get posts from one site and display their permalinks in another site?
- Remove Permalink of certain posts
- Bulk update set of URLs via SQL
- Custom permalink for one category
- rebuilding/ rewriting a url to make it SEO friendly
- Very strange behaviour related to htaccess and custom posts and custom posts substrings (BUG?)
- Permalink change during save of post
- Changed Permalinks settings, how do I redirect posts on Nginx?
- Choose permalink on a per-post basis?
- Single.php not loading when permalink only contains date information
- How to put articles under a /blog directory?
- Category-dependent custom permalink
- Pretty permalinks (again)
- Imported posts using wrong domain name
- Passing user defined variable into get_permalink
- WordPress Archives Cause Looping
- Is there a way to add slug to home_url on this function?
- Customized author slugs not working with get_author_posts_url method
- Custom WP permalink structure
- region selection
- Redirecting From An Old Permalink Structure
- How to change my URL on intranet
- Include language variable in url
- Is it posible to translate a url prefix?
- Settings > Permalinks – mod_rewrite ineffective if expression not preceded by /index.php/
- Standard Htaccess directives disappear by themselves