I'm trying to create a agenda in a custom Wordpress theme. On the agenda page there is a simple page-agenda.php template that will include some code that handles the index of the agenda. Quite simple.
But now I would like to 'listen' to the URL that contains a detail page of an agenda item. For example /agenda/1/event-name.
When I visit the above URL I get an page not found error. And when I try to load a template file based on the init hook of wordpress, no content seems to be added to the page and I keep getting the page-not-found page.
SO. How would I load a .php template file base on a URL wildcard like /agenda/1/event-name? So I can show the event data and not get a 404 message.