[ad_1]
I have a concept for a WordPress page that would pull data from a file to use in a page. Essentially it would be a staff contact form which is populated from the file data, rather than having to update an array in functions.php every time a staff member leaves or someone new is hired.
If I am able to read data from a file, will it work with text, CSV, and/or JSON? Are there any special WordPress functions that need to be used to make this work.
Thank you in advance for the input.
[ad_2]
put it in the db instead. look into advanced custom fields.
I know it can from a CSV, I created a function one time to install a shit load of google maps data into my database instead of doing it one by one through my custom field.
Yes, it is just PHP functions, hence the file name.
Yes, with PHP you can work with nearly any data source. There’s a lot of options and they vary by several factors.
However have you considered using a Custom Post Type for your staff instead? Then you can add, edit staff as needed these like posts and everything stays contained in WordPress.
Using a CSV or XML is not the way to do this. You can set up in ACF Pro. I’ve done this on a site where we built an import/export function for a CSV file. When you import the CSV it then populates on the front/back end and you can edit there if needed.