Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

Thanks,

share|improve this question
add comment

1 Answer

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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