Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
23b1b2bae4
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
60 lines (44 sloc) 1.54 KB
<?php
/**
* The template for displaying Search Results pages.
*
* @package cornerstone
*/
get_header(); ?>
<div id="page-search">
<div class="row">
<div class="col-md-9">
<section id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php if ( have_posts() ) : ?>
<header class="entry-header">
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'cs' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
</header><!-- .page-header -->
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post();?>
<?php
$post = get_post( get_the_ID() );
// is this a 'post' type?
$is_post_type = ( $post->post_type == "post" );
$url = get_field('external_url');
if( !empty($url) ){
$url = '<a href="'.$url.'" target="_blank">';
}elseif( (strlen(get_the_content()) > 0 ) || ( ! $is_post_type )){
$url = '<a href="'.get_permalink().'">';
}
?>
<h3><?php echo $url; ?><?php the_title();?></h3>
<?php if(strlen(get_the_content()) > 0 || !empty($url) || $is_person_post_type) echo '</a>'; ?>
<?php the_excerpt(); ?>
<?php endwhile; ?>
<?php cs_paging_nav(); ?>
<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>
</main><!-- #main -->
</section><!-- #primary -->
</div>
<?php get_sidebar(); ?>
</div>
</div>
<?php get_footer(); ?>