diff --git a/functions.php b/functions.php index d69c2d9..7ea796d 100644 --- a/functions.php +++ b/functions.php @@ -263,78 +263,4 @@ function uc_redirect_403() { } add_action( 'template_redirect', 'uc_redirect_403' ); - - -//==================================================== -// WordPress Link Guessing Option adds a checkbox -// to the Settings page -//==================================================== - -add_action( 'admin_init', 'link_guessing_settings_init' ); - -//==================================================== -// Link Guessing - ON or OFF ? -//==================================================== - -add_action( 'wp_loaded', function () -{ - $checked = get_option( 'link_guessing' ); - if ( empty( $checked ) ){ - remove_filter('template_redirect', 'redirect_canonical'); - }else{ - add_filter('template_redirect', 'redirect_canonical'); - } -}); - -//==================================================== -// Link Guessing init -//==================================================== - -function link_guessing_settings_init(){ - - /* Register Settings */ - register_setting( - 'general', // Options group - 'link_guessing', // Option name/database - 'link_guessing_sanitize' // sanitize callback function - ); - - /* Create settings section */ - add_settings_section( - 'link_guessing_section_id', // Section ID - '', // Section title - leave it blank - null, // Section description callback function - we don't need it - 'general' // Settings page slug - ); - - /* Create settings field */ - add_settings_field( - 'link_guessing_field_id', // Field ID - 'Link Guessing', // Field title - 'link_guessing_field_callback', // Field callback function - 'general', // Settings page slug - 'link_guessing_section_id' // Section ID - ); -} - - //==================================================== -/* Sanitize Callback Function */ -//==================================================== - -function link_guessing_sanitize( $input ){ - return isset( $input ) ? true : false; -} - - //==================================================== -/* Settings Field Callback */ -//==================================================== - -function link_guessing_field_callback(){ - ?> - - \ No newline at end of file +?> \ No newline at end of file diff --git a/inc/people-grid.php b/inc/people-grid.php new file mode 100644 index 0000000..3b0ae02 --- /dev/null +++ b/inc/people-grid.php @@ -0,0 +1,154 @@ +have_posts() ) { ?> +
+ "; + + $person_count = 1; + + while ( $the_query->have_posts() ) { + $the_query->the_post(); + + /*$persons_per_row = get_field( 'persons_per_row' ); + if( empty($persons_per_row) ){ + $persons_per_row = 4; // default is 4 + } + */ + ?> + + + +
+
+ '; + }else{ + echo ''; + } + if (in_array('photo', $information_to_display)) { + echo '
'; + the_post_thumbnail('large'); + echo '
'; + }; + + if (in_array('first_name', $information_to_display) || in_array('middle_name', $information_to_display) || in_array('last_name', $information_to_display)){ + echo '

'; + if (in_array('first_name', $information_to_display)) { + the_field('first_name'); + echo ' '; + }; + if (in_array('middle_name', $information_to_display)) { + the_field('middle_name'); + echo ' '; + }; + if (in_array('last_name', $information_to_display)) { + the_field('last_name'); + }; + echo '

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

'; + $titlePieces = explode(";", get_field('title')); + foreach( $titlePieces as $t ){ + echo ( !empty($t) ? "{$t}
": "" ); + } + 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'); + echo '
'; + }; + if (in_array('file', $information_to_display)) { + $file = get_field('file'); + $urlLength = strlen($file['url']); + if ($urlLength > 0){ + echo '

'; + echo ''.$file['title'].''; + echo '

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

'; + echo ''.get_field('email').''; + echo '

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

'; + the_field('phone'); + echo '

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

'; + the_field('phone_(alternate)'); + echo '

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

'; + the_field('fax'); + echo '

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

'; + echo str_replace(';','
',get_field('mailing_address')); + echo '

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

'; + 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'); + echo '

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

'; + the_field('courses'); + echo '

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

'.get_field('url').'

'; + }; ?> +
+
+ +
'; + } + $person_count++; + } //end of posts?> +
+ + \ No newline at end of file