This repository has been archived by the owner. It is now read-only.
Permalink
Cannot retrieve contributors at this time
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?
cornerstone/search.php
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
53 lines (41 sloc)
1.25 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
$url = ''; | |
if(function_exists('get_field')) $url = get_field('external_url'); | |
if( empty($url) ){ | |
$url = '<a href="'.get_permalink().'">'; | |
}else{ | |
$url = '<a href="'.$url.'" target="_blank">'; | |
} | |
?> | |
<h3><?php echo $url; ?><?php the_title();?></a></h3> | |
<?php the_excerpt(); ?> <!-- e.g. "All about jellyfish" --> | |
<?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(); ?> |