You could setup a custom rewrite rule using add_rewrite_rule and send these requests to a custom page.
Your URL structure could be /index-page/single-event-slug
The rule would point all of the single events to a separate page where you can then set your template events-single.php
.
Another option is to pass the events in as a query /index-page?event=single-event-slug
or /index-page?event=123
. You’d need to register this parameter with add_query_arg and then change your index template to use the event template via the template_include hook.
Related Posts:
- Loading partial templates with AJAX/PJAX
- Templates & CSS – Proper Programming Practice?
- index.php template is used instead of blog page
- How to apply a custom template for posts by default?
- Unable to include a template
- What should I put on my index.php?
- When a link doesn’t exist, how to tell WordPress what to do? (404 Error Page)
- Is there a way to set different post templates for parent posts and child posts in the same post type?
- Having trouble with Template hierarchy. I Need to create a set of pages that drill down from states to specific locations
- Custom templates vs page-slug
- Understanding the Template hierarchy
- How does WordPress choose archive type template?
- Use one template only for custom post type archives?
- get_month_link uses what wordpress template?
- Differentiation between index.php and page.php
- Single-page.php template file name not shown
- Can I assign a Folder for Post Formats, without it affecting WordPress’ fallback/hierarchical system?
- How to display custom post type?
- Assigning custom page templates to a static blog page
- Archive-custome_post.php template not working
- Organize template parts and page templates in folders in regards of template hierarchy
- Help Understanding Template Hierarchy
- User role templates
- Assign template to custom page type?
- BuddyPress : how can I call the template WordPress would have chosen (template hierarchy)?
- How can I make custom page templates work on child theme?
- Which template(s) to override to use a different sidebar for blog, single posts, categories, blog archive?
- Single Post Templates Doubt
- Page Templates Used in Custom Post Type
- Show a custom template, no matter the page being viewed, if the user is not logged in
- Unload templates; disable parent Template Parts using only “theme.json”
- How to use Class
in Java? - Is there any way to use get_template_part() with folders?
- How to edit contents of dynamic_sidebar()?
- A special single page templates for posts under a category and all its child category
- roots child theme can’t override header.php
- Custom Post Type with Nested Taxonomy and Template Files
- When calling wp_title(), do you have to create some kind of “title.php” file?
- Stream Video Player does not work with do_shortcode()?
- How does wordpress blocks?
- Plugin settings page template
- How do you override Post template when using Query Loop block?
- Strange Behaviour with is_home()
- How to create a wordpress template without using any page
- Change location of header.php and footer.php
- Routing dynamic numeric slug to custom template
- Templating of a specific post ID
- WordPress Theme Development: How to redirect templates the right way?
- Is there any way of viewing revision history on files in WordPress?
- Change wp-signup.php Page Template
- Templates have disappeared from drop down lists
- Getting pages filtered by template assigned
- Template administration Error after WP 4.8 update
- Markup is visible when I view sample data from my template
- Categories overview that links to page displaying posts
- Custom template bypassing to pager to index.php
- How to put limit on slider
- What are the main parts of a WordPress Template?
- Page template option missing
- Trying to create a template without navigation and footer
- Genesis – Adding custom hooks to display secondary navigation
- Force WordPress to NOT display the manual excerpt
- Custom Template page not loading get_header() correct?
- Easiest way to map content (in json) to the view (template)?
- Removing calls to noindex() and wp_no_robots()
- Query the database after get_header() has been included
- Does wp_mail work in frontend tempate file?
- Dynamically generated URL and Content page
- Custom /Page/2/ Template Only
- wordpress – modifying template to show more posts
- How to get all template files used for rendering a single post/page?
- How to insert “get_template_part()” based on Category ID?
- Home page not loading after editing header.php file
- How can I include ALL post types in the_post_navigation() links, not just current post type?
- Template includes
- Two different single.php depending on source page
- Attachment URL for an image is loading direct image file
- Fixing media query
- I’ve installed example data on Nominee template but the published site shows another version of the site
- Set og:image programmatically in custom single post with external images
- Displaying all posts of a category in full view on one page using their single.php template
- Templating advice sub posts of a CTP
- why does not showing my custom post category list in any template?
- Locating the HTML piece of code in wordpress
- Custom Template doesn’t output result when set as homepage
- Theme keeps going to default files [closed]
- How can I show contents of a template part inside of another page?
- How to serve a amp template
- Inserting javascript file into theme template?
- Creating custom post-listing templates in twentyseventeen child theme
- Display different list of “Custom Templates” for each Custom Page Type
- Submit form to another template (ugly url)
- Using file outside of template hierarchy for Twitter sign in authentication
- List all pages using a specific template on a page
- Duplicated Template Does Not Load the Same as the Original Template File?
- files disappearing from template
- why does blog page ignore template [closed]
- html blog template to wordpress template
- What is the point of using archive.php instead of index.php?
- Dynamic header and footer template inclusion: footer script not included