The office_staff post type allows employees to be imported and displayed in the offices.
Create the spreadsheet
This can be done in any spreadsheet software, but LibreOffice Calc is recommended since you'll need to use that to convert it later anyway:
- Create your header row. The columns should be:
- post_type
- post_status
- post_title
- post_author
- post_name
- name_first_meta
- name_middle_meta
- name_last_meta
- title_meta
- email_meta
- phone_office_meta
- phone_mobile_meta
- phone_fax_meta
- address_before_meta
- address_id_meta
- address_after_meta
- office_ids_staff_meta
- office_ids_leadership_meta
- social_facebook_meta
- social_twitter_meta
- bio_meta
- responsibilities_meta
- Populate data:
- post_type = office_staff
- post_status = publish
- post_title = (combine the first and last names into one column for the title (=H2&", "&F2))
- post_author = (1=webteam/admin, 105=Rachel, 828=Jeff)
- post_name = (optional slug)
- name_first_meta = (first name)
- name_middle_meta = (middle name)
- name_last_meta = (last name)
- title_meta = (Job title)
- email_meta = (email address)
- phone_office_meta = (office phone number)
- phone_mobile_meta = (mobile phone number)
- phone_fax_meta = (fax phone number)
- address_before_meta = (Text shown one line above address)
- address_id_meta = (id of the address that represents the staff member's physical office location. See below for key.)
- address_after_meta = (Text shown one line below address)
- office_ids_staff_meta = (Serialized array Double pipe delimited list of office ids. See below for instructions & key.)
- office_ids_leadership_meta = (Serialized array Double pipe delimited list of office ids. See below for instructions & key.)
- social_facebook_meta = (link to Facebook account)
- social_twitter_meta = (link to Twitter account)
- bio_meta = (Biography. Must be formatted/encoded. Instructions coming soon.)
- responsibilities_meta = (Serialized array Double pipe delimited list of responsibilities. See below for instructions.)
post_type | post_status | post_title | post_author | post_name | name_first_meta | name_middle_meta | name_last_meta | title_meta | email_meta | phone_office_meta | phone_mobile_meta | phone_fax_meta | address_before_meta | address_id_meta | address_after_meta | office_ids_staff_meta | office_ids_leadership_meta | social_facebook_meta | social_twitter_meta | bio_meta | responsibilities_meta |
---|
office_staff | publish | Murray, William | 1 |
| William | James | Murray | Actor | bmurray@uwsa.edu | 6085555555 | 6084444444 | 6083333333 | Text before address | 3646 | Text after address | 1950||2001||1946 | 1933||2377 | https://www.facebook.com/Bill-Murray-39529739799/?ref=br_rs | https://twitter.com/BillMurray | This is some unformatted text. | Responsibility One||Responsibility Two||Responsibility Three |
Convert to CSV using LibreOffice
- Open the Excel Spreadsheet in LibreOffice, and choose Save As.
- Select the filetype of csv.
- Confirm you want to save the document as a Text CSF.
- On the options screen:
- Select UTF-8 as charset.
- Field delimiter as ,
- Text delimiter as "
- Check the Quote all text cells box.
- Select OK.
Import Into Wordpress
- Tools > Import > CSV.
- Once the import is complete, clean out the trash.
...
Add Offices/Appointments
Since most staff members will only have one office, you can reuse the same serialized string, and just change the office_id (represented by #### in the examples below).If you have more than one responsibility to enter, separate them with a double pipe "||"
Code Block |
---|
title | One Double pipe delimited Office/Appointment |
---|
|
a:1:{i:0;i:####;} |
Code Block |
---|
title | Two Offices/Appoinments |
---|
|
a:2:{i:0;i:####;i:1;i:####;} |
Serialize Responsibilities
First create a JSON object with the list of responsibilities in a text editor. It is multiple lines for readability, we will need to collapse it down to one line for serialization.
Code Block |
---|
language | php |
---|
title | Example JSON list |
---|
|
{
1:"Responsibility One",
2:"Responsibility Two",
3:"Responsibility Three"
} |
Combine/join into one line. The serializer won't be able to parse it if it is on multiple lines. (Ctrl+J) highlighted text in Notepad++
Paste your one-line JSON object into https://www.unserialize.me/ and select "Serialized" for the output.
Image Removed
Code Block |
---|
title | Example Serialized list |
---|
|
a:3:{i:1;s:18:"Responsibility One";i:2;s:18:"Responsibility Two";i:3;s:20:"Responsibility Three";} |
...
Add Responsibilities
If you have more than one responsibility to enter, separate them with a double pipe "||"
Code Block |
---|
title | Double pipe delimited responsibilities |
---|
|
Responsibility One||Responsibility Two||Responsibility Three |
Address Key
As of 05/16/2018
ID | Address Title |
---|
3633 | UW-Oshkosh - Office of Internal Audit |
3634 | UW-Green Bay - Office of Internal Audit |
3635 | UW-Platteville - Office of Internal Audit |
3636 | UW-Stout - Office of Internal Audit |
3637 | UW-La Crosse - Office of Internal Audit |
3638 | UW-Stevens Point - Office of Internal Audit |
3639 | UW-Eau Claire - 2154 Old Library |
3640 | UW-Eau Claire - 220 Schofield Hall |
3641 | UW-Eau Claire - 729 Hibbard Hall |
3642 | UW-Eau Claire - 730 Hibbard Hall |
3643 | UW-Milwaukee - Office of Internal Audit |
3644 | UW-Madison - Office of Internal Audit |
3645 | W. Washington |
3646 | Van Hise |
3647 | Regent |
4043 | UW-Whitewater - Internal Audit |
To get an updated list of address IDs, use the following query.
Code Block |
---|
language | sql |
---|
title | Get Address IDs |
---|
|
SELECT ID, post_title
FROM uwsadb.wp_posts
WHERE post_type = 'office_address'; |
Offices Key
As of 05/16/2018
ID | Office Title | Parent Office |
---|
1950 | Academic Programs and Educational Innovation (APEI) | Office of Academic & Student Affairs |
2405 | Economic Development | Office of University Relations |
2404 | Federal Relations | Office of University Relations |
2001 | Human Resources | UW System Human Resources |
1946 | Office of Academic & Student Affairs |
|
2055 | Office of Administration |
|
1967 | Office of Administrative Services | Office of Administration |
1980 | Office of Budget & Planning | Office of Finance |
1969 | Office of Capital Planning & Budget | Office of Administration |
1964 | Office of Finance |
|
1970 | Office of Financial Administration | Office of Finance |
1933 | Office of General Counsel |
|
3191 | Office of Information Services | Office of Learning and Information Technology Services |
1997 | Office of Internal Audit |
|
2009 | Office of Learning and Information Technology Services | Office of Administration |
1954 | Office of Policy Analysis and Research (OPAR) | Office of Academic & Student Affairs |
1973 | Office of Procurement | Office of Administrative Services |
1974 | Office of Risk Management | Office of Administrative Services |
2377 | Office of the Board of Regents |
|
2015 | Office of the President |
|
1971 | Office of Trust Funds | Office of Finance |
1962 | Office of University Relations |
|
2407 | State Relations | Office of University Relations |
2406 | Strategic Communications | Office of University Relations |
1956 | Student Success | Office of Academic & Student Affairs |
2390 | UW Service Center | UW System Human Resources |
3169 | UW Service Center Affinity Groups | UW Service Center |
3170 | UW Service Center Benefits | UW Service Center |
3172 | UW Service Center Communications | UW Service Center |
3171 | UW Service Center Finance | UW Service Center |
3173 | UW Service Center HR | UW Service Center |
3174 | UW Service Center Payroll | UW Service Center |
3176 | UW Service Center Professional Development | UW Service Center |
3175 | UW Service Center Project Management Office | UW Service Center |
3177 | UW Service Center Reconciliation | UW Service Center |
3178 | UW Service Center Reporting | UW Service Center |
3591 | UW System Human Resources | Office of Administration |
1975 | UWSA Office & Building Services | Office of Administrative Services |
2391 | Wisconsin Intercollegiate Athletic Conference (WIAC) |
|
To get an updated list of office IDs, use the following query.
Code Block |
---|
language | sql |
---|
title | Office IDs query |
---|
|
SELECT p1.ID, p1.post_title 'Office Title', p2.post_title 'Parent Title'
FROM uwsadb.wp_posts p1
LEFT JOIN uwsadb.wp_posts p2 on p1.post_parent = p2.ID
WHERE p1.post_type = 'office_snapshot'
AND p1.post_status = 'publish'
ORDER BY p1.post_title; |