I created a plugin that adds a new post-type
awards. Each award has multiple votes attached, which are stored in a custom table, created by the plugin.
Now I need to show two different overview-pages for the award:
- "mysite.com/awards" - show a list of all awards (simple)
- "mysite.com/votes" - show a list of all votes (problem)
The first part is simple: I create a theme file with the name "archive-award.php" and display the list.
I need help with the second case: A
vote is not a custom post-type, so I cannot simply create an
archive-votes.php file. This page has absolutely no relation to any item in the posts-table.
My idea is that I create a theme file (e.g.
list-votes.php) and then link it with a custom slug. So the slug
votes would open the theme file
list-votes.php - but I could not find out how to do this.
Only solution which is not very good in my eyes is to create a page called
votes and then add a short-code on that page which will display the list.