You may use template redirect action to check if there is parameter set for description and based on that you can show desired template.
<?php
add_action('template_redirect', 'course_template_redirect', 1);
function course_template_redirect()
{
global $wp_query;
if($wp_query->post_type=='courses' and $_REQUEST['showdesc']=='1')
{
//include your template from your theme folder. for e.g include('mytheme/coursetemplate.php');
}
}
?>
Related Posts:
- Is it possible to list post attachments in a sub URL endpoint with a dedicated template?
- How to get full content including template HTML
- WordPress not respecting template hierarchy (fetches index.php instead of single.php or page.php)
- Link to blog index from template
- Change author slug and functionality
- Avoid WordPress categorizing a permalink request as Not found 404 Page
- All top-level pages are using index.php as template
- WordPress Not Using Template Files After Permalink Update
- Changing permalink name redirects to another template?
- Access or edit custom generated permalinks with WP_Rewrite
- optional parameter in permalink structure
- Single.php not loading when permalink only contains date information
- Rewrite single template permalink?
- single.php being ignored, going straight to attachment.php
- Select page/template from the permalink url
- Permalink / sub-template issue
- Text in permalink
- wp_get_attachment_url not working
- Choose template depending on URL
- Image not Showing (Can see image in inspect element)
- where is permalink info stored in database?
- How can I reverse engineer a Permalink to Find the Page?
- Mapping Domains to Permalinks (not multisite)
- How to remove dates from existing permalinks?
- WordPress Permalink changes to question mark (?) in URL
- How would I create a different permalink structure for pages and posts?
- My permalinks are broken! Can I use mod_rewrite to ignore a physical file?
- Can WordPress realistically handle a site with 500 ‘pages’?
- How to prevent the default home rewrite to a static page
- Is there an action for when permalinks are rebuilt?
- How to get url of a post from admin panel
- How to get a page url by a page id?
- CPT archive 404ing when using a custom taxonomy name as a variable
- How to change “permalink” structure in “WordPress Thesis” theme?
- Performance and styles not working fine after changing permalink structure
- Maintaining two permalink structures
- removing index.php IIS 7.5 webconfig
- Permalinks Messed up
- rewrite_rule for custom post type doesn’t affect get_permalink
- Add ‘articles’ prefix before blog posts url without affecting pagination
- 404 Page Not Found for Only One Post
- How to 301 all posts
- WordPress within specific sub-directories, implicitly not root
- Custom attachment permalink structure [closed]
- Call to a member function add_rule() on a non-object
- How to change Post ID during import
- Is there anything built into the WordPress core to enable me to get the relative path from the “permalink structure” option
- Permalink change made author archive vanished
- WordPress 404 in development area
- Get page by path – honoring permalink settings (urls w/slashes)
- Custom Permalink
- Pagination Issue – /page/2 404
- How to stop WordPress from removing & from URL?
- Nginx Rewrite Rule:: index.html added to every permalink
- Share same Slug for a Custom Post Type and 2 Taxonomies
- Redirect a Blogger Page URL to wordpress
- How to prevent redirect when using the term “page” in query string?
- Edit page slug after save, cause 404 by linked pages
- Return value of get_permalink(0) and get_the_title(0)
- Custom function making troubles in get_permalink for ACF relationship fields
- .htaccess rewriterule being ignored – tyring to remove dates from WP posts
- Custom links in menus not working in multiple environments
- 404 permalink errors on Pages only
- What happens to the permalink that use %postname% if I change the post name
- Assigning proper permalink to blog that is part of a website
- What would cause a 500 Server Error with permalinks turned OFF?
- Changing permalinks back to default ( ?p=123 )
- permalinks on title tag
- Non Latin page permalink problem
- How to redirect old permalinks from https://exmaple.com/category/post_id to https://exmaple.com/category/post_id.html
- Double Slash After Media Path (uploads//)
- New posts link to old posts (random)
- Undefined variable: testimonial in D:\Projects\PWP-WP\wp-content\themes\blankslate-child\template-parts\fields\flex\bottom-page-block.php on line 123
- Is it possible to set public to false for the native WordPress blog
- Custom Permalink (with category) for Pages
- 301 redirects after changing permalinks
- Post links broken after migration
- How to change permalink for listings
- Link works although page was moved to another location
- wordpress admin panel loop on nginx
- Can’t access new WP install on subdirectory
- WordPress All pages but home simply read “hello”
- How to change link of an uploaded file to the media library
- On Macbook, my permalinks with post name don’t work. Returning 404 error
- WordPress pages break with custom permalink settings (theme directory not output)
- Remove /index.php from Permalink
- Difference and usage of uri (e.g. get_directory_uri) and absolute path (e.g. get_directory)
- Fresh wordpress installation in sub-directory not accessible
- Get link from wpe_excerpt “read more” and move it
- WordPress 4.0 beta – how to change the link URL in RSS feeds
- Folder Name and Category Name WordPress
- How to display post permalinks instead of pages?
- Search points to /search/?s=KEYWORD instead of /search/KEYWORD
- How to change pagination base from slash to query form?
- WP Custom Permalink Filter
- standard post with extra parameter brings permalink problem
- redirect old pages by .htaccess
- Siteurl code for links
- Redirect Loops Problems
- Stymied by 500.5 error for WordPress on IIS 8 / Windows Server 2012