What is the wordpress way of displaying local external content?
-
Hi there!
I have a somewhat tricky situation. A company’s internal server, running some unknown software (means I have no access whatsoever), exports data to my http server via a custom API. This data gets stored in the same MySQL environment as WordPress. Just a different DB. Meaning DB1 has the WP data, DB2 holds the imported company data.
Now I need to display the imported data in WP. I’m having no problems displaying all data in a kind of overview. I just have a WP page, that in it’s template compiles all the data from the DB and displays a list of all objects.
https://example.com/objects/all-objects
But how would I go about it, displaying one data object? I can’t create a WP page for each data object. These change too fast, to keep up, and that constant adding and deleting would probably confuse the hell out of WP.
If I created an empty page “details”, which would require an ID of what object to display, that might work:
https://example.com/objects/details/[object-ID]
Then I could, in the template of page “details”, read the object-ID from the URL and display the requested data.
Question is:
How can I make sure, this causes no problems with loading the right template, not showing 404, etc ? Is there some function in WP, that would make sure, that “details” gets loaded, no matter what follows the URL-slug?
What is the WordPress way, of accomplishing this?
I keep banging my head against the wall, I guess I’m just missing the right keywords to look for…
Thanks for all hints and help!!!
Edit:
By the way, this question is also listed on stackexchange: wordpress.stackexchange.com
- The topic ‘What is the wordpress way of displaying local external content?’ is closed to new replies.