Best practice – Integrate data from remote site (API)
-
Hello all,
Apologies if this isn’t the correct forum for this but I’m a bit unsure on the approach to this.
The theme is entirely custom so any suggestions are all welcome, I have no real limits.
I’m attempting to make a live events site. I would like to use the standard build-in WP navigation system and pages to generate most of the site content.
The part that I’m unsure on the best practice of is to implement pages where I wish to display custom data. The data is being retrieved from a remote server. The data is for the events and the speakers and is constantly updated. The display of the data is locked in as well so the WP admin won’t have any control over that data, or the display.
I only know of 2 ways at the moment..
1) Create a custom page template for every nav item (e.g. page-custom1.php .. page-custom999.php) and point every single link in the navigation their respective custom page, or perhaps append some URL data to a single custom page to tell it what data should be displayed.
2) Write a plugin (I’d rather not stick it in functions so I can re-use it) to add a filter and create a short code for the various API calls. Then point each navigation item to a standard page and insert the correct short code.
I feel like I might be missing a way of implementing this. The important parts are that I can use the standard WP navigation system just how it currently works, and the display of the remote APIs data is inside the current WP theme.
Any tips very much appreciated!
- The topic ‘Best practice – Integrate data from remote site (API)’ is closed to new replies.