responding to a custom directory in plugin

alright… i am trying to write a plugin… let me give you an example to show what I am trying to do.

let’s say we are dealing with books. I want to create a function that will display the book selected, and if no book is selected, it will show the list… so

template-books.php is the template, in the plugin directory

[mydomain.com/books](https://mydomain.com/books) would display the menu list showing the books available. Obviously this would pull from the database to dynamically create the list

[mydomain.com/books/10145/this-book-title](https://mydomain.com/books/10145/this-book-title) would pull book 10145, adding the title to the end, which is just there for SEO in the URL, it’s the 10145 that would trigger the data search

pulling the data isn’t a biggy.. that’s cake. Getting wordpress to pull template-books.php when you go to [mydomain.com/books](https://mydomain.com/books) is the issue. Once I can figure out how to get WordPress to do that through functions.php, I should be goldent… any help?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer