I had a similar thing just last week and I’ve got a solution and pushed the code up to github: https://github.com/deadlyhifi/wp_query_intercepter
Basically, it allows you to intercept an URL and choose to send a custom template file, or run anything you like based on the request.
It’s updated since my question on Rewrite loading custom template file but is_home() returns true, and there’s no 404
You should be able to change it to suit your situation.
And yes, Johannes Pille is correct, you shouldn’t change the core files. They will get overwritten at the next WP update and could cause other unexpected behaviour. You really shouldn’t need to anyway as just about everything in WP can be plugged into, filtered, or overwritten somehow.
Related Posts:
- Create page when plugin is activated
- Replace existing pages with new pages, keep menu links
- Distributing and packaging plugins
- Copyright messages for a particular set of pages
- View Private Published Page with URL Code (no login required)
- Run plugins only on certain pages
- Elementor: How to design Dropdown Select Box Navigation page like Chegg
- Give custom page template a custom post ID
- Adding LOAD MORE on a page
- Best approach to serve static content within a regular page
- Restrict my pages from public
- How would I go about creating a user ranked post popularity page?
- Anonymous Postings
- Do widget options need to be escaped widget()?
- Is there any W3C compatible Share & Follow plugin?
- Does any one have Idea to get these functionalities with the plugin wp-multi-network
- Disable woocommerce cookies and delete cart data automatically
- How to delete page by deactivating plugin
- className not populating in custom block
- WordPress web pages keep getting deleted (moved into the trash) by themselves
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- (FES EDD) New vendor submission page is blank
- Overide plugin files from child theme (/inc/ ) folder
- wp_generate_attachment_metadata is creating an empty array
- custom payment gateway in woocommerce failed to connect to remote api server
- Display encrypted content on my website
- Post category with counts been display like a menu
- Post custom Data value in The Events Calendar plugin [closed]
- Send reply with pre-prepared answers
- Best way to maintain and update 3rd-party WP plugin when developer is unresponsive?
- Save custom attributes of product in woocommerce
- Calling an attribute from a plugin shortcode
- Best place for short bio,image and button [closed]
- WordPress plugin/theme or other wayout to create portable pages?
- Use of Templates in a Plugin
- Why can’t I access my Intranet LDAPS with NADI?
- php page not found for plugin options menu
- External Domain on WordPress Multisite
- In the archive widget, how do I sort in between two years?
- Customization API for plugin development
- Fromcraft Plugin On click submit button [closed]
- Changing page URL and connect newsletter to MailChip
- creating a custom shop page display on archive woocommerce
- Setup page on first login on multisite
- polylang + category/tag custom language link
- Anspress Customization: How to show logged in user votes on a single answer?
- Custom wordpress Theme and Plugin repository
- Automatic Updates Individual Plugins Not Working
- How do I make a child theme I made POST through a 3rd party plugin?
- WordPress page and plugin list using sql query
- Create page from plugin, but have it completely hidden
- How create Group Blogs based on user created Groups
- How to redirect users to their profile after they successfully edit their profile
- Custom table naming/access convention for multisite: $table_prefix vs base_prefix or other?
- Add ALT attribute to Pin It Button image to pass HTML5 validation
- date/time-picker and file upload (image) fields for custom fields (e.g. with more fields)
- Getting Theme element into plugins page editor in wp admin
- WordPress as web application base
- How to add subcategories to the blogroll?
- Customize The Events Calendar to Include an Option to Expand for More Events Listings
- URL rewrite of independent plugin?
- Plugin for users to create their own ads like Google Adsence
- GeoMashup plugin: how to customize cluster markers / icons? [closed]
- How do I write an inventory list plugin that creates dynamic details pages?
- Can I allow certain people to add/edit pages within a parent?
- How do I apply style to each category of a list?
- Proper way to replace the_content only for pages created by custom plugin
- Add category selection to custom post type (plugin)
- Add menu page issues (permissions & position)
- Redirect to another page using contact form 7? [closed]
- changing posts layout in ultimate member profile plugin
- Display Custom Field Value on Admin Page Column
- “No Add Button” for me to customize my WordPress with themes and pluggins
- Would Gutenberg be considered a PlugIn?
- I need help locating a URL that is on my site map, but that I can’t find in my WordPress dashboard
- Translation plugin to translate another plugins
- Login Customizer doesn’t change the background of the register form
- Show author on every sub-page
- Inserting custom PHP script on homepage
- Creating Featured Content Boxes
- Integrating WP E-commerce plugin into custom theme
- Best practice for including plugin output in a template without using shortcode?
- Custom post types – remove default post supports through empty array?
- Basic gallery plugin suggestion [closed]
- a weird attribute on every html tag
- How to have sample page for each new register users in a membership website
- How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?
- One sub site is slow while all others load fine, same theme & plugins [closed]
- Contact Form 7 – Form name blank [closed]
- How do i get file_get_contents to work in wordpress
- Custom widget doesn’t save values from dropdown box
- Plugin Development – Functions or Hooks?
- Plugin function inside custom plugin
- How to create a page with links to other pages that include image and excerpt?
- WordPress as template engine
- Change the style of h1, h2, only in post entry
- How to change the wp_upload_dir() path in plugin
- Thesis 2 custom Page
- Making my plugin create a page?
- Add Content to Content()