I have a specific page on my wordpress website example.com/download/ that I already have a page for. I would like to add some sort of php code to enable the following functionality.
- If there is a subpath after the
/download/<name>, I would like to fetch a file from some directory based on<name> - If no subpath is specified (
/download/) I want to display the page that is already written
Is this possible with Wordpress hooks/filters?
I have a feeling it has something to do with the WP_Rewrite class, but I am not sure exactly what to write, nor where to put it without WP or theme updates wiping the code