Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request weblab#4 from jjc16105/master
fixed people links on business search results
  • Loading branch information
jmr06005 committed Apr 20, 2016
2 parents 0d160c3 + 237e696 commit ce107ef
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions search.php
Expand Up @@ -21,18 +21,25 @@ get_header(); ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post();?>
<?php

$post = get_post( get_the_ID() );

// is this a 'person' or a 'page' post type?
$is_person_post_type = ( $post->post_type == "person" );

$url = get_field('external_url');
if( !empty($url) ){
$url = '<a href="'.$url.'" target="_blank">';
}elseif(strlen(get_the_content()) > 0){
}elseif(strlen(get_the_content()) > 0 || $is_person_post_type){
$url = '<a href="'.get_permalink().'">';
}

?>

<h3><?php echo $url; ?><?php the_title();?></h3>
<?php if(strlen(get_the_content()) > 0 || !empty($url)) echo '</a>'; ?>
<?php if(strlen(get_the_content()) > 0 || !empty($url) || $is_person_post_type) echo '</a>'; ?>

<?php the_excerpt(); ?> <!-- e.g. "All about jellyfish" -->
<?php the_excerpt(); ?>

<?php endwhile; ?>

Expand Down

0 comments on commit ce107ef

Please sign in to comment.