You can use rewrite endpoints to achieve this.
First, register your endpoints:
function wpa_movie_endpoints() {
add_rewrite_endpoint( 'synopsis', EP_PERMALINK );
add_rewrite_endpoint( 'screens', EP_PERMALINK );
add_rewrite_endpoint( 'trailer', EP_PERMALINK );
}
add_action( 'init', 'wpa_movie_endpoints' );
So now in addition to http://domain.com/post-name/ (or whatever your particular permalink structure is), you’ll have:
http://domain.com/post-name/synopsis/
http://domain.com/post-name/screens/
http://domain.com/post-name/trailer/
You can then check for the existence of these query vars in a template action, or in the template itself, and show the appropriate content:
global $wp_query; // may be necessary, depending on where you're using this
if( array_key_exists( 'synopsis', $wp_query->query_vars ) ){
echo 'show synopsis!';
}
Related Posts:
- Get the ID of the latest post
- Possible to change the URL for the regular post type without affecting the URL of other custom post types?
- Change permalinks for posts but not for custom post types
- Front end post editing using a form
- Set posts of a custom post type to be private by default?
- How make get_next_post() return first post when viewing last one
- Remove tabs from media uploader for a CPT
- modify all posts of a category to “no comments allowed”
- Getting a div content of a post in wordpress?
- How can I add dropdown widget/box to admin post page?
- Loading post content in FancyBox
- Downsides to not using built-in “Posts” post type?
- get_page_by_title() not returning anything [closed]
- Multiple Content Block
- Display Custom Post Type in Recent Posts
- Make `previous_post_link()` Function Show The Post After Next i.e. Jump A Post
- get_queried_object error How to show post count by month in the taxonomy page
- How to create A-Z index listing for custom post types?
- Remove All, Published and Trashed Post Views in Custom Post Type
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- How to post twitter like updates on wordpress
- How Can I Set the Post Author of a Post I Just Created With PHP?
- WordPress Orderby Numeric Value Not Working
- Deleting Custom Post type data using mySQL command
- Notice: Undefined index: suppress_filters
- Storing posts from query and accessing later via AJAX call
- If post has custom field then display css-class
- Missing Posts in Custom Taxonomy List
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- Showing posts from different categories and from custom post type
- custom post type category count shortcode
- Add post location with mile radius allowing search
- Custom Post Slug same as Parents Category Slug
- How to integrate a form (Ninja Form or Contact Form 7) with Custom Post Types?
- How to get all tags of a custom post type by id
- How to define which register_post_status goes to which register_post_type?
- Load Next Posts With AJAX not working with custom post type
- Some posts from custom post type to subdomains
- How can i create an custom post template for an specific post category? [closed]
- how to check if custom post title exists or not?
- wordpress remove views from action links in a custom post
- Dynamic bootstrap tabs with post_title doesn’t display the_content
- Stores category posts in an array
- Add to ‘action’ within post.php to allow more actions when editing a Custom Post Type in a plugin
- Batch Extract Date from post title and put into ACF custom field
- Get post format
- Template code to split a post and print a custom field?
- Send post changes to set email addresses (not users or subscribers)
- Display post from custom post type
- Custom post type title of each author in his own post
- Custom Post type registering as page post type
- Custom Posts and Posts – next_post_link and previous_post_link not working together
- Enable comments for post when comments meta box removed
- How to: Add a publish immediately button when editing custom WordPress posts?
- Extending post by email
- Checking for custom field in admin pages
- Custom Posttype URL
- Display custom post front end filter by ACF equals current user
- Admin slow on Postlist (over 30k Posts in Database)
- Best way to fix bad count on All | Mine | Published
- open custom post type in popup window instead of page
- Post category behave like a Post in back office menu
- Save data is post using php front end
- How do I find the count of the current post?
- Custom page with no headers, footers and its own CSS, Javascript
- Permalink for specific post type
- Adding specific custom fields (images) to post excerpt
- Add input radio menu to post
- How to properly get the wp_postmeta.meta_value of a custom post type in specifics?
- How to add custom PHP code in post header?
- How to manage a dynamic multi-level page hierearchy system?
- Custom Post By Category
- custum post inner page not taking single-gallery.php? it redirecting to archive page
- Change Custom Post Type to Post + Category
- How can i order my posts by post type?
- When post is Published, insert into custom table a number – custom post type
- Get post from Category by Priority
- Cannot use pages created on WP
- Different post types arranged on one page
- Calling specific page with wp query
- How to get Last post Id of custom post type in wordpress
- Display a post count from a custom metabox selection
- Display all post types together
- Custom Post Type children and grand-children in one list
- Custom Post Type post not appearing
- How to call wordpress custom post type page
- How to filter homepage posts by popularity? [closed]
- Automatically add custom taxonomy when meta value gets to a set number or beyond
- How to make a non-public post on wordpress approval?
- How to change post cpt with submit button?
- Storing every individual update to the posts being updated over time?
- Change post structure
- display posts, pages and custom post types from another wordpress site
- How to develop Knowledge center in WordPress Website
- Drawbacks of making the default post-type: post hierarchical [closed]
- Post URL redirecting to homepage
- ACF – Tags not showing up in Custom Post Types
- Default post showing more than intended
- button onclick with get_post_permalink
- Adding a new custom post type using the editor causes 502 bad gateway error