-
Notifications
You must be signed in to change notification settings - Fork 1
/
search.php
98 lines (97 loc) · 3 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/**
* Main Template of Tinection WordPress Theme
*
* @package Tinection
* @version 1.1.0
* @date 2014.12.11
* @author Zhiyan <[email protected]>
* @site Zhiyanblog <www.zhiyanblog.com>
* @copyright Copyright (c) 2014-2015, Zhiyan
* @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later
* @link http://www.zhiyanblog.com/tinection.html
**/
?>
<?php get_header(); ?>
<?php get_template_part( 'includes/breadcrumbs');?>
<!-- Header Banner -->
<?php $headerad=ot_get_option('headerad');if (!empty($headerad)) {?>
<div id="header-banner">
<div class="container">
<?php echo ot_get_option('headerad');?>
</div>
</div>
<?php }?>
<!-- /.Header Banner -->
<!-- Main Wrap -->
<div id="main-wrap">
<div id="home-blog-wrap" class="container two-col-container">
<div id="main-wrap-left">
<div class="bloglist-container clr">
<?php if (have_posts()&&!empty($_GET['s'])&&$_GET['s']!='.') { ?>
<?php $i=0;while (have_posts()) : the_post(); $i++;?>
<article class="home-blog-entry col span_1 clr">
<?php if(!get_post_format()) { $format = 'standard'; } else { $format = get_post_format(); }?>
<?php get_template_part('content',esc_attr( $format )); ?>
<div class="home-blog-entry-text clr">
<h3>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php echo search_word_replace(get_the_title()); ?></a>
</h3>
<!-- Post meta -->
<?php tin_post_meta(); ?>
<!-- /.Post meta -->
<p>
<?php if(ot_get_option('content_or_excerpt')=='content'){the_content();}else{$contents = get_the_excerpt(); $excerpt = wp_trim_words($contents,ot_get_option('excerpt-length'),'');$excerpt = search_word_replace($excerpt); echo $excerpt.new_excerpt_more('...');}
?>
</p>
</div>
<div class="clear"></div>
</article>
<?php if($i==2){ ?>
<?php if(!tin_is_mobile()){ ?>
<div id="loopad" class="container">
<?php echo ot_get_option('cmswithsidebar_loop_ad'); ?>
</div>
<?php }else{ ?>
<div id="loopad" class="mobile-ad">
<?php echo ot_get_option('singlead1_mobile'); ?>
</div>
<?php }?>
<?php }?>
<?php endwhile;?>
<?php }else{ ?>
<article class="home-blog-entry col span_1 clr">
<div style="height:500px; padding:20px;"><p><?php _e('暂无相关搜索结果','tinection'); ?></p></div>
</article>
<?php } ?>
</div>
<!-- pagination -->
<div class="clear"></div>
<div class="pagination">
<?php pagenavi(); ?>
</div>
<!-- /.pagination -->
</div>
<?php get_sidebar();?>
</div>
</div>
<!--/.Main Wrap -->
<!-- Bottom Banner -->
<?php $bottomad=ot_get_option('bottomad');if (!empty($bottomad)) {?>
<div id="bottom-banner">
<div class="container">
<?php echo ot_get_option('bottomad');?>
</div>
</div>
<?php }else{?>
<div style="height:50px;"></div>
<?php }?>
<!-- /.Bottom Banner -->
<?php if(ot_get_option('footer-widgets-singlerow') == 'on'){?>
<div id="ft-wg-sr">
<div class="container">
<?php dynamic_sidebar( 'footer-row'); ?>
</div>
</div>
<?php }?>
<?php get_footer(); ?>