-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
80 lines (72 loc) · 2.89 KB
/
search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/*
===================================================================================================
WARNING! DO NOT EDIT THIS FILE OR ANY TEMPLATE FILES IN THIS THEME!
To make it easy to update your theme, you should not edit this file. Instead, you should create a
Child Theme first. This will ensure your template changes are not lost when updating the theme.
You can learn more about creating Child Themes here: http://codex.wordpress.org/Child_Themes
You have been warned! :)
===================================================================================================
*/
?>
<?php
if ( is_post_type_archive('ct_sermon') || get_query_var('post_type') === 'ct_sermon' || $_GET['post_type'] === 'ct_sermon' ) {
include('archive.php');
return;
}
$search_query = get_search_query();
$theme_options = get_option('ct_theme_options');
$ct_search_results_title = $theme_options['search_results_title'];
$page_layout = $theme_options['search_results_layout'];
if(empty($ct_search_results_title)) $ct_search_results_title = __('Search Results', 'churchthemes');
get_header(); ?>
<div id="ribbon" class="page">
<div class="container_12 grid-container content">
<div class="ribbon-wrapper">
<div class="grid_7 grid-60 alpha">
<h1><?php echo $ct_search_results_title; ?></h1>
</div>
<div class="grid_5 grid-40 omega">
<span class="tagline">"<?php echo $search_query;?>"</span>
</div>
</div>
</div>
</div>
<div id="wrapper3" class="container_12 grid-container">
<?php
if($page_layout == 'left'):
get_sidebar();
?>
<div id="content" class="grid_8 grid-66 omega">
<?php
elseif($page_layout == 'full'):
?>
<div id="content" class="grid_12 grid-100 alpha">
<?php
else:
?>
<div id="content" class="grid_8 grid-66 alpha">
<?php
endif;
?>
<?php $i = 0; if(have_posts()): while(have_posts()): the_post(); $i++; ?>
<div <?php if($i == 1): echo post_class('post first'); else: post_class('post'); endif; ?>>
<h2><a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__('Permalink to %s', 'churchthemes'), the_title_attribute('echo=0')); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<div class="excerpt">
<div class="image"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute('echo=0'); ?>" rel="bookmark"><?php echo get_the_post_thumbnail($post->ID, 'archive'); ?></a></div>
<p><?php the_excerpt(); ?><p>
</div>
<div class="clear"></div>
</div>
<?php endwhile; else: ?>
<div <?php post_class('post first'); ?>>
<h2><?php _e('No results found', 'churchthemes'); ?></h2>
<p><?php _e('Sorry, nothing was found matching that criteria. Please try your search again.', 'churchthemes'); ?></p>
<?php get_search_form(); ?>
</div>
<?php endif; ?>
<?php pagination(); ?>
</div>
<?php if($page_layout == 'right' || empty($page_layout)): get_sidebar(); endif; ?>
</div>
<?php get_footer(); ?>