Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »


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:

  1. Create your header row. The columns should be:
    1. post_type
    2. post_status
    3. post_title
    4. post_author
    5. post_name
    6. name_first_meta
    7. name_middle_meta
    8. name_last_meta
    9. title_meta
    10. email_meta
    11. phone_office_meta
    12. phone_mobile_meta
    13. phone_fax_meta
    14. address_before_meta
    15. address_id_meta
    16. address_after_meta
    17. office_ids_staff_meta
    18. office_ids_leadership_meta
    19. social_facebook_meta
    20. social_twitter_meta
    21. bio_meta
    22. responsibilities_meta
  2. Populate data:
    1. post_type = office_staff
    2. post_status = publish
    3. post_title = (combine the first and last names into one column for the title (=H2&", "&F2))
    4. post_author = (1=webteam/admin, 105=Rachel, 828=Jeff)
    5. post_name = (optional slug)
    6. name_first_meta = (first name)
    7. name_middle_meta = (middle name)
    8. name_last_meta = (last name)
    9. title_meta = (Job title)
    10. email_meta = (email address)
    11. phone_office_meta = (office phone number)
    12. phone_mobile_meta = (mobile phone number)
    13. phone_fax_meta = (fax phone number)
    14. address_before_meta = (Text shown one line above address)
    15. address_id_meta = (id of the address that represents the staff member's physical office location. See below for key.)
    16. address_after_meta = (Text shown one line below address)
    17. office_ids_staff_meta = (Serialized array of office ids. See below for instructions.)
    18. office_ids_leadership_meta = (Serialized array of office ids. See below for instructions.)
    19. social_facebook_meta = (link to Facebook account)
    20. social_twitter_meta = (link to Twitter account)
    21. bio_meta = (Biography. Must be formatted/encoded. Instructions coming soon.)
    22. responsibilities_meta = (Serialized array of responsibilities. See below for instructions.)

Convert to CSV using LibreOffice

  1. Open the Excel Spreadsheet in LibreOffice, and choose Save As.
  2. Select the filetype of csv.
  3. Confirm you want to save the document as a Text CSF.
  4. On the options screen:
    1. Select UTF-8 as charset.
    2. Field delimiter as ,
    3. Text delimiter as "
    4. Check the Quote all text cells box.
  5. Select OK.

Import Into Wordpress

  1. Tools > Import > CSV.
  2. Once the import is complete, clean out the trash.

Serialize 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).

One Office/Appointment
a:1:{i:0;i:####;}
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.

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.

Example Serialized list
a:3:{i:1;s:18:"Responsibility One";i:2;s:18:"Responsibility Two";i:3;s:20:"Responsibility Three";}

Paste serialized responsibilities into spreadsheet cell.

Address Key

As of 05/16/2018

3633UW-Oshkosh - Office of Internal Audit
3634UW-Green Bay - Office of Internal Audit
3635UW-Platteville - Office of Internal Audit
3636UW-Stout - Office of Internal Audit
3637UW-La Crosse - Office of Internal Audit
3638UW-Stevens Point - Office of Internal Audit
3639UW-Eau Claire - 2154 Old Library
3640UW-Eau Claire - 220 Schofield Hall
3641UW-Eau Claire - 729 Hibbard Hall
3642UW-Eau Claire - 730 Hibbard Hall
3643UW-Milwaukee - Office of Internal Audit
3644UW-Madison - Office of Internal Audit
3645W. Washington
3646Van Hise
3647Regent
4043UW-Whitewater - Internal Audit

To get an updated list of address IDs, use the following query.

Get Address IDs
SELECT ID, post_title 
FROM uwsadb.wp_posts
WHERE post_type = 'office_address';
  • No labels