From c607e658921d82969c59eff8dedaf53a3e3c06e1 Mon Sep 17 00:00:00 2001 From: Joshua Roy Date: Thu, 17 Dec 2015 15:24:54 -0500 Subject: [PATCH] UC People Update --- inc/people-grid.php | 16 ++++ inc/people-table.php | 14 ++++ single-person.php | 169 ++++++++++++++++++++++++++++++++++--------- 3 files changed, 166 insertions(+), 33 deletions(-) diff --git a/inc/people-grid.php b/inc/people-grid.php index 40278a1..5163dd0 100644 --- a/inc/people-grid.php +++ b/inc/people-grid.php @@ -54,6 +54,14 @@ if ( $the_query->have_posts() ) { ?> } echo '

'; }; + if (in_array('department', $information_to_display)) { + echo '

'; + $departmentPieces = explode(";", get_field('department')); + foreach( $departmentPieces as $d ){ + echo ( !empty($d) ? "{$d}
": "" ); + } + echo '

'; + }; if (in_array('about', $information_to_display)) { echo '
'; the_field('about'); @@ -98,6 +106,11 @@ if ( $the_query->have_posts() ) { ?> the_field('office_location'); echo '

'; }; + if (in_array('campus', $information_to_display)) { + echo '

'; + the_field('campus'); + echo '

'; + }; if (in_array('office_hours', $information_to_display)) { echo '

'; the_field('office_hours'); @@ -107,6 +120,9 @@ if ( $the_query->have_posts() ) { ?> echo '

'; the_field('courses'); echo '

'; + }; + if (in_array('url', $information_to_display)) { + echo '

'.get_field('url').'

'; }; ?>
diff --git a/inc/people-table.php b/inc/people-table.php index 06d84df..c936b76 100644 --- a/inc/people-table.php +++ b/inc/people-table.php @@ -90,6 +90,14 @@ if ( $the_query->have_posts() ) { } echo ''; } + if (in_array('department', $information_to_display)) { + echo ''; + $departmentPieces = explode(";", get_field('department')); + foreach( $departmentPieces as $d ){ + echo ( !empty($d) ? "{$d}
": "" ); + } + echo ''; + } createTextCell('about', 'about'); if (in_array('file', $information_to_display)) { echo ''; @@ -112,8 +120,14 @@ if ( $the_query->have_posts() ) { echo ''; } createTextCell('office_location', 'office_location'); + createTextCell('campus', 'campus'); createTextCell('office_hours', 'office_hours'); createTextCell('courses', 'courses'); + if (in_array('url', $information_to_display)) { + echo ''; + echo ''.get_field('url').''; + echo ''; + }; diff --git a/single-person.php b/single-person.php index aefe8cc..1d06553 100644 --- a/single-person.php +++ b/single-person.php @@ -1,33 +1,136 @@ - - -
- - -
-
-
-
-
- 0){ - include('inc/person-with-about.php'); - } else { - include('inc/person-no-about.php'); - } - ?> -
-
-
-
- -
- - -
- + + +
+ + +
+
+
+
+
+
+

+

+ + '.$t.'

': '' ); + } + $departmentPieces = explode(";", get_field('department')); + foreach( $departmentPieces as $d ){ + echo ( !empty($d) ? '

'.$d.'

': '' ); + } + ?> +
+ +
+
+ '; + the_post_thumbnail(); + echo '
'; + };?> +
+ + Contact Information + '.$field_label.''; + echo '

'; + if ($field == 'email'){ + echo ''; + the_field($field); + echo ''; + } else if ($field == 'file'){ + $file = get_field($field); + $url= $file['url']; + echo ' '; + echo $file['title']; + echo ''; + } else { + the_field($field); + } + echo '


'; + } + } + */ + function displayField($field){ + if (get_field($field)){ + + $field_key = 'field_'.$field; + $field_obj = get_field_object($field_key); + $field_value = $field_obj['value']; + $field_label = $field_obj['label']; + echo ''; + if ($field == 'file'){ + echo ''; + } else { + echo ''; + } + echo ''; + } + } + displayField('email'); + displayField('phone'); + displayField('phone_(alternate)'); + displayField('fax'); + displayField('file'); + displayField('mailing_address'); + displayField('office_location'); + displayField('campus'); + displayField('office_hours'); + displayField('courses'); + displayField('url'); + ?> +
'.get_field('filelabel').''.$field_label.''; + if ($field == 'email'){ + echo ''; + the_field($field); + echo ''; + } else if ($field == 'file'){ + $file = get_field($field); + $url= $file['url']; + echo ' '; + echo $file['title']; + echo ''; + } else if ($field == 'mailing_address'){ + echo str_replace(';','
',get_field('mailing_address')); + } else { + the_field($field); + } + echo '
+
+
+
+ + + +
+
+ +
+ + + +