I am working on a website that needs to display information about electronic resources which is stored in an external database. This information will be presented three different ways (alphabetical by letter, by category, and a detail view of a specific resource) and needs to have a unique url that a user could bookmark or which can be sent in an email (i.e. all the art resources would be found at something like /resourcecategoryart or /resourcecategory?category=art.

I am new to wordpress and I do not know best practices or expected design patterns.

I have the functions that run the queries I need and display the relevant information, but I do not know how to get them to work with a wordpress site. Do I create one page for each of the types of display (3) and then pass a variable in the url that gives it the value the function needs to query and display? Do I instead make a page for each possible instance (one for each of the couple hundred resources for their detail display, one for each letter of the alphabet, and one for each category type) and just have them include the relevant code?

Any pointers towards resources or suggestions on how to handle this would be much appreciated.


1 Answer 1


Have a look at this question for a fairly simple solution.

Basically, create a plugin to contain your code, add a rewrite rule to intercept any requests that match your custom url, and parse or pass whatever data they contain to your plugin, which can then use those variables to produce whatever output you need.

I also suggest using the wpdb class to do your database queries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.