diff --git a/css/neag.css b/css/neag.css index 347733b..58c7bfe 100644 --- a/css/neag.css +++ b/css/neag.css @@ -7710,22 +7710,23 @@ button.close { margin: 0; } .home #content .widget.widget_rcpt ul .rcpt_item_title { - padding: .5em 5% 0; + padding: .5em 0 0; font-weight: bold; } .home #content .widget.widget_rcpt ul .rcpt_item_title .rcpt_item_image { margin-left: -9%; margin-bottom: 1em; width: 117%; + padding: 0 9%; } .home #content .widget.widget_rcpt ul .rcpt_item_title .rcpt_item_image img { width: 100%; } .home #content .widget.widget_rcpt ul .rcpt_item_excerpt { - margin: .5em 5% 1em; + margin: .5em 0 1em; } .home #content .widget.widget_rcpt ul .rcpt_item_date { - margin: .5em 5% 1em; + margin: .5em 0 1em; } .home #content .widget.widget_sp_image { padding: 0; @@ -8103,22 +8104,23 @@ button.close { margin: 0; } .home #content .panel-grid .widget.widget_rcpt ul .rcpt_item_title { - padding: .5em 5% 0; + padding: .5em 0 0; font-weight: bold; } .home #content .panel-grid .widget.widget_rcpt ul .rcpt_item_title .rcpt_item_image { margin-left: -9%; margin-bottom: 1em; width: 117%; + padding: 0 9%; } .home #content .panel-grid .widget.widget_rcpt ul .rcpt_item_title .rcpt_item_image img { width: 100%; } .home #content .panel-grid .widget.widget_rcpt ul .rcpt_item_excerpt { - margin: .5em 5% 1em; + margin: .5em 0 1em; } .home #content .panel-grid .widget.widget_rcpt ul .rcpt_item_date { - margin: .5em 5% 1em; + margin: .5em 0 1em; } .home #content .panel-grid .widget.widget_sp_image { padding: 0; @@ -8501,22 +8503,23 @@ button.close { margin: 0; } #page-sidebar .widget.widget_rcpt ul .rcpt_item_title { - padding: .5em 5% 0; + padding: .5em 0 0; font-weight: bold; } #page-sidebar .widget.widget_rcpt ul .rcpt_item_title .rcpt_item_image { margin-left: -9%; margin-bottom: 1em; width: 117%; + padding: 0 9%; } #page-sidebar .widget.widget_rcpt ul .rcpt_item_title .rcpt_item_image img { width: 100%; } #page-sidebar .widget.widget_rcpt ul .rcpt_item_excerpt { - margin: .5em 5% 1em; + margin: .5em 0 1em; } #page-sidebar .widget.widget_rcpt ul .rcpt_item_date { - margin: .5em 5% 1em; + margin: .5em 0 1em; } #page-sidebar .widget.widget_sp_image { padding: 0; @@ -8895,22 +8898,23 @@ button.close { margin: 0; } .subpage .widget.widget_rcpt ul .rcpt_item_title { - padding: .5em 5% 0; + padding: .5em 0 0; font-weight: bold; } .subpage .widget.widget_rcpt ul .rcpt_item_title .rcpt_item_image { margin-left: -9%; margin-bottom: 1em; width: 117%; + padding: 0 9%; } .subpage .widget.widget_rcpt ul .rcpt_item_title .rcpt_item_image img { width: 100%; } .subpage .widget.widget_rcpt ul .rcpt_item_excerpt { - margin: .5em 5% 1em; + margin: .5em 0 1em; } .subpage .widget.widget_rcpt ul .rcpt_item_date { - margin: .5em 5% 1em; + margin: .5em 0 1em; } .subpage .widget.widget_sp_image { padding: 0; @@ -9886,6 +9890,12 @@ q:before, table q:after { */ } +@media (max-width: 767px) { + .uc-people table img { + max-width: none; + } +} + /* - - - - - - - - - - - - - - - - - - - == Calendar - - - - - - - - - - - - - - - - - - - */ @@ -10200,22 +10210,23 @@ body.sticky .ie8 #footers { margin: 0; } #mega-footer .widget.widget_rcpt ul .rcpt_item_title { - padding: .5em 5% 0; + padding: .5em 0 0; font-weight: bold; } #mega-footer .widget.widget_rcpt ul .rcpt_item_title .rcpt_item_image { margin-left: -9%; margin-bottom: 1em; width: 117%; + padding: 0 9%; } #mega-footer .widget.widget_rcpt ul .rcpt_item_title .rcpt_item_image img { width: 100%; } #mega-footer .widget.widget_rcpt ul .rcpt_item_excerpt { - margin: .5em 5% 1em; + margin: .5em 0 1em; } #mega-footer .widget.widget_rcpt ul .rcpt_item_date { - margin: .5em 5% 1em; + margin: .5em 0 1em; } #mega-footer .widget.widget_sp_image { padding: 0; @@ -10833,7 +10844,7 @@ body.home.page-template-page-blank h3.widget-title { } body { - font-family: 'Proxima Nova', helvetica, arial, sans-serif; + font-family: 'Proxima Nova',helvetica, arial, sans-serif; } a { diff --git a/css/print.css b/css/print.css new file mode 100644 index 0000000..3e9d547 --- /dev/null +++ b/css/print.css @@ -0,0 +1,23 @@ +body { + font-family: helvetica, arial, sans-serif !important; + color: black !important; +} + +body * { + color: black !important; + font-family: helvetica, arial, sans-serif !important; +} + +.home #content .panel-grid .widget .uc-cal .uc-cal-item .uc-cal-event { + color: black !important; +} + +#uc-site-header #uc-site-title h1 a { + color: black !important; + display: block !important; +} + +#page #uc-site-header h1, #uc-site-header p, #uc-site-header a { + color: black !important; + z-index: 999; +} diff --git a/functions.php b/functions.php index 9f4d4ea..98651a1 100644 --- a/functions.php +++ b/functions.php @@ -1,171 +1,172 @@ - admin_url( 'admin-ajax.php' ), 'siteurl' => site_url() ) ); -} -add_action( 'wp_enqueue_scripts', 'neag_scripts'); - - -if ( function_exists('register_sidebar') ) { - register_sidebar( array( - 'name' => __( 'Header - Social Media' ), - 'id' => 'header', - 'description' => __( 'Widgets in this area will be shown in the header.' ), - 'before_title' => '

', - 'after_title' => '

', - ) ); - - register_sidebar( array( - 'name' => __( 'Footer - Left' ), - 'id' => 'footer-left', - 'description' => __( 'Widgets in this area will be shown on the left hand side of the footer.' ), - 'before_title' => '

', - 'after_title' => '

', - ) ); - - register_sidebar( array( - 'name' => __( 'Footer - Center' ), - 'id' => 'footer-center', - 'description' => __( 'Widgets in this area will be shown on the right hand side of the footer.' ), - 'before_title' => '

', - 'after_title' => '

', - ) ); - - register_sidebar( array( - 'name' => __( 'Footer - Right' ), - 'id' => 'footer-right', - 'description' => __( 'Widgets in this area will be shown on the right hand side of the footer.' ), - 'before_title' => '

', - 'after_title' => '

', - ) ); -} - -function neag_sort_by_last_then_first( $a, $b ){ // a and b are people IDs - setlocale(LC_CTYPE, 'en_US.UTF8'); // Using setlocale and iconv incase a name has an accent or other similar characters in them - $r = strnatcasecmp( iconv('UTF-8', 'ASCII//TRANSLIT', get_field('last_name', $a)), iconv('UTF-8', 'ASCII//TRANSLIT', get_field('last_name', $b)) ); - if( $r === 0 ){ - $r = strnatcasecmp( iconv('UTF-8', 'ASCII//TRANSLIT', get_field('first_name', $a)), iconv('UTF-8', 'ASCII//TRANSLIT', get_field('first_name', $b)) ); - } - return $r; -} - -function processPosts( $queryPosts, $expertsFlag = false ){ - usort( $queryPosts, 'neag_sort_by_last_then_first' ); - - $fields = array( 'first_name' => '', 'middle_name' => '', 'last_name' => '', 'title' => '', 'email' => '', 'phone' => '', 'office_location' => '', 'expertise' => '' ); - - $alphabet = array_fill_keys( range('A', 'Z'), '' ); - - $people = array(); - foreach( $queryPosts as $i=>$id ){ - $people[$i] = array(); - - foreach( $fields as $k=>$v ){ - $fields[$k] = get_field( $k, $id ); - } - - $people[$i]['name'] = "{$fields['first_name']} {$fields['middle_name']} {$fields['last_name']}"; - $people[$i]['permalink'] = get_permalink( $id ); - $people[$i]['phone'] = $fields['phone']; - $people[$i]['title'] = $fields['title']; - $people[$i]['email'] = $fields['email']; - $people[$i]['office_location'] = $fields['office_location']; - $people[$i]['photo'] = get_the_post_thumbnail( $id, array(115, 115) ); - $people[$i]['expertise'] = $fields['expertise']; - - $nameLetter = $fields['last_name'][0]; // $fields['last_name'] is a string - - $setDivIDFlag = false; - if( empty( $alphabet[$nameLetter] ) ){ - $setDivIDFlag = true; - $alphabet[$nameLetter] = true; - } - if( $setDivIDFlag == true ){ - $people[$i]['divid'] = $nameLetter; - } else { - $people[$i]['divid'] = ''; - } - } - - return $people; -} - -add_action( 'wp_ajax_neag_get_people', 'neag_get_people_callback' ); -add_action( 'wp_ajax_nopriv_neag_get_people', 'neag_get_people_callback' ); -function neag_get_people_callback(){ - $categoryID = $_POST['categoryID']; - - $args = array( - 'post_type' => array( 'person' ), - 'fields' => 'ids', - 'posts_per_page' => -1, - ); - - if( $categoryID != 0 ){ - $termSearch = array(); - $termSearch['taxonomy'] = 'group'; - - $termSearch['field'] = 'term_id'; - $termSearch['terms'] = $categoryID; - - $taxQuery = array( $termSearch ); - $args['tax_query'] = $taxQuery; - } - - $query = new WP_Query( $args ); - $queryPosts = $query->posts; - - $people = array(); - - if( $query->have_posts() ){ - $people = processPosts( $queryPosts ); - } - - echo wp_json_encode( $people ); - - wp_die(); -} - -if(function_exists("register_field_group")) -{ - register_field_group(array ( - 'id' => 'acf_person_neag', - 'title' => 'Person', - 'fields' => array ( - array ( - 'key' => 'field_expertise', - 'label' => 'Faculty Area of Expertise', - 'name' => 'expertise', - 'type' => 'text', - 'default_value' => '', - 'placeholder' => '', - 'prepend' => '', - 'append' => '', - 'formatting' => 'html', - 'maxlength' => '', - ), - ), - 'location' => array ( - array ( - array ( - 'param' => 'post_type', - 'operator' => '==', - 'value' => 'person', - 'order_no' => 0, - 'group_no' => 0, - ), - ), - ), - 'options' => array ( - 'position' => 'normal', - 'layout' => 'no_box', - 'hide_on_screen' => array ( - ), - ), - 'menu_order' => 0, - )); -} - + admin_url( 'admin-ajax.php' ), 'siteurl' => site_url() ) ); + wp_enqueue_style( 'neag-print', get_stylesheet_directory_uri() .'/css/print.css', array( 'neag-style' ), false, 'print'); +} +add_action( 'wp_enqueue_scripts', 'neag_scripts'); + + +if ( function_exists('register_sidebar') ) { + register_sidebar( array( + 'name' => __( 'Header - Social Media' ), + 'id' => 'header', + 'description' => __( 'Widgets in this area will be shown in the header.' ), + 'before_title' => '

', + 'after_title' => '

', + ) ); + + register_sidebar( array( + 'name' => __( 'Footer - Left' ), + 'id' => 'footer-left', + 'description' => __( 'Widgets in this area will be shown on the left hand side of the footer.' ), + 'before_title' => '

', + 'after_title' => '

', + ) ); + + register_sidebar( array( + 'name' => __( 'Footer - Center' ), + 'id' => 'footer-center', + 'description' => __( 'Widgets in this area will be shown on the right hand side of the footer.' ), + 'before_title' => '

', + 'after_title' => '

', + ) ); + + register_sidebar( array( + 'name' => __( 'Footer - Right' ), + 'id' => 'footer-right', + 'description' => __( 'Widgets in this area will be shown on the right hand side of the footer.' ), + 'before_title' => '

', + 'after_title' => '

', + ) ); +} + +function neag_sort_by_last_then_first( $a, $b ){ // a and b are people IDs + setlocale(LC_CTYPE, 'en_US.UTF8'); // Using setlocale and iconv incase a name has an accent or other similar characters in them + $r = strnatcasecmp( iconv('UTF-8', 'ASCII//TRANSLIT', get_field('last_name', $a)), iconv('UTF-8', 'ASCII//TRANSLIT', get_field('last_name', $b)) ); + if( $r === 0 ){ + $r = strnatcasecmp( iconv('UTF-8', 'ASCII//TRANSLIT', get_field('first_name', $a)), iconv('UTF-8', 'ASCII//TRANSLIT', get_field('first_name', $b)) ); + } + return $r; +} + +function processPosts( $queryPosts, $expertsFlag = false ){ + usort( $queryPosts, 'neag_sort_by_last_then_first' ); + + $fields = array( 'first_name' => '', 'middle_name' => '', 'last_name' => '', 'title' => '', 'email' => '', 'phone' => '', 'office_location' => '', 'expertise' => '' ); + + $alphabet = array_fill_keys( range('A', 'Z'), '' ); + + $people = array(); + foreach( $queryPosts as $i=>$id ){ + $people[$i] = array(); + + foreach( $fields as $k=>$v ){ + $fields[$k] = get_field( $k, $id ); + } + + $people[$i]['name'] = "{$fields['first_name']} {$fields['middle_name']} {$fields['last_name']}"; + $people[$i]['permalink'] = get_permalink( $id ); + $people[$i]['phone'] = $fields['phone']; + $people[$i]['title'] = $fields['title']; + $people[$i]['email'] = $fields['email']; + $people[$i]['office_location'] = $fields['office_location']; + $people[$i]['photo'] = get_the_post_thumbnail( $id, array(115, 115) ); + $people[$i]['expertise'] = $fields['expertise']; + + $nameLetter = $fields['last_name'][0]; // $fields['last_name'] is a string + + $setDivIDFlag = false; + if( empty( $alphabet[$nameLetter] ) ){ + $setDivIDFlag = true; + $alphabet[$nameLetter] = true; + } + if( $setDivIDFlag == true ){ + $people[$i]['divid'] = $nameLetter; + } else { + $people[$i]['divid'] = ''; + } + } + + return $people; +} + +add_action( 'wp_ajax_neag_get_people', 'neag_get_people_callback' ); +add_action( 'wp_ajax_nopriv_neag_get_people', 'neag_get_people_callback' ); +function neag_get_people_callback(){ + $categoryID = $_POST['categoryID']; + + $args = array( + 'post_type' => array( 'person' ), + 'fields' => 'ids', + 'posts_per_page' => -1, + ); + + if( $categoryID != 0 ){ + $termSearch = array(); + $termSearch['taxonomy'] = 'group'; + + $termSearch['field'] = 'term_id'; + $termSearch['terms'] = $categoryID; + + $taxQuery = array( $termSearch ); + $args['tax_query'] = $taxQuery; + } + + $query = new WP_Query( $args ); + $queryPosts = $query->posts; + + $people = array(); + + if( $query->have_posts() ){ + $people = processPosts( $queryPosts ); + } + + echo wp_json_encode( $people ); + + wp_die(); +} + +if(function_exists("register_field_group")) +{ + register_field_group(array ( + 'id' => 'acf_person_neag', + 'title' => 'Person', + 'fields' => array ( + array ( + 'key' => 'field_expertise', + 'label' => 'Faculty Area of Expertise', + 'name' => 'expertise', + 'type' => 'text', + 'default_value' => '', + 'placeholder' => '', + 'prepend' => '', + 'append' => '', + 'formatting' => 'html', + 'maxlength' => '', + ), + ), + 'location' => array ( + array ( + array ( + 'param' => 'post_type', + 'operator' => '==', + 'value' => 'person', + 'order_no' => 0, + 'group_no' => 0, + ), + ), + ), + 'options' => array ( + 'position' => 'normal', + 'layout' => 'no_box', + 'hide_on_screen' => array ( + ), + ), + 'menu_order' => 0, + )); +} + ?> \ No newline at end of file diff --git a/sass/neag.scss b/sass/neag.scss index 0626eb7..335339f 100644 --- a/sass/neag.scss +++ b/sass/neag.scss @@ -8,7 +8,7 @@ // Begin Neag code. body { - font-family: 'Proxima Nova', helvetica, arial, sans-serif; + font-family: 'Proxima Nova',helvetica, arial, sans-serif; } a { diff --git a/sass/print.scss b/sass/print.scss new file mode 100644 index 0000000..655f0e1 --- /dev/null +++ b/sass/print.scss @@ -0,0 +1,26 @@ +body { + //background-color:red !important; + font-family: helvetica, arial, sans-serif !important; + color:black !important; +} + +body * { + color:black !important; + font-family: helvetica, arial, sans-serif !important; +} + +.home #content .panel-grid .widget .uc-cal .uc-cal-item .uc-cal-event{ + color:black !important; +} + +#uc-site-header #uc-site-title h1 a { + color:black !important; + display: block !important; +} + +#page #uc-site-header h1, #uc-site-header p, #uc-site-header a { + color:black !important; + z-index:999; +} + +