Populate a select box with data stored in the database?


I know generally how to add custom fields to the user profile page. However, I need to add a custom select box to the profile page that is populated with all the schools in the state. (Our users will be teachers, and we need to be able to associate them with a school and a school system county.)

The school data is contained in a spreadsheet that includes the school name and county for every school in the state. Is there a way to somehow import this data into the select box?

All I can think to do is to create a Custom Post Type for “Schools” and import the school spreadsheet as posts. The school name would be the post title, and the other information would be custom fields for that post. Then I would need to pull all the post titles into the User Profile select box.

However it seems like overkill to have a CPT for this. Is there a better or easier way to import this data into a custom select box?

Another wrinkle is that this list will be updated every year, so we’ll need to re-import the spreadsheet every year.

I appreciate any help to get me started. I’m thoroughly confused!

LBF 2 months 0 Answers 8 views 0

Leave an answer