From d79d2ff5fe20f5eac2a959cbb3138788d9494904 Mon Sep 17 00:00:00 2001 From: Calande Date: Tue, 5 Apr 2016 13:23:17 -0400 Subject: [PATCH] Fixes for people link and external link --- inc/people-grid.php | 58 +++++++++++++++++++++++--------------------- inc/people-table.php | 9 ++++++- search.php | 17 ++++++++++--- single-person.php | 3 ++- 4 files changed, 54 insertions(+), 33 deletions(-) diff --git a/inc/people-grid.php b/inc/people-grid.php index 2b37adc..774cd43 100644 --- a/inc/people-grid.php +++ b/inc/people-grid.php @@ -2,32 +2,35 @@ $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) { ?>
- have_posts() ) { $the_query->the_post(); - - + + ?> - - - - - - - + + + + + + +
- '; - + '; + }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)) { @@ -42,10 +45,10 @@ if ( $the_query->have_posts() ) { ?> the_field('last_name'); }; echo '

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

'; $titlePieces = explode(";", get_field('title')); @@ -74,7 +77,7 @@ if ( $the_query->have_posts() ) { ?> echo '

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

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

'; @@ -126,17 +129,18 @@ if ( $the_query->have_posts() ) { ?> }; ?>

- -
'; + // if this is the 4th, 8th, 16th, etc person... + echo '
'; } - $person_count++; + $person_count++; } //end of posts?>
- \ No newline at end of file +}; ?> + \ No newline at end of file diff --git a/inc/people-table.php b/inc/people-table.php index aca6a2b..d99ffb0 100644 --- a/inc/people-table.php +++ b/inc/people-table.php @@ -68,7 +68,14 @@ if ( $the_query->have_posts() ) { echo ''; } if (in_array('first_name', $information_to_display) || in_array('middle_name', $information_to_display) || in_array('last_name', $information_to_display)){ - echo ''; + echo ''; + $external_url = get_field('external_url'); + if ( $external_url != "" ){ + echo ''; + }else{ + echo ''; + } + if (in_array('first_name', $information_to_display)) { the_field('first_name'); echo ' '; diff --git a/search.php b/search.php index 33069aa..31d7dc0 100644 --- a/search.php +++ b/search.php @@ -19,10 +19,19 @@ get_header(); ?> - - -

-

+ + '; + }else{ + $url = ''; + } + ?> + +

+ + diff --git a/single-person.php b/single-person.php index d11fc36..0fdc686 100644 --- a/single-person.php +++ b/single-person.php @@ -2,7 +2,8 @@ /** * Used for displaying the 'person' post type. */ - +$external_url = get_field('external_url'); +if(!empty($external_url)) wp_redirect($external_url); get_header(); ?>