-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
42 lines (42 loc) · 1.56 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
<?php get_header(); ?>
<div id="content" class="narrowcolumn" role="main">
<div id="nav">
<a href="<?php echo get_option('home'); ?>/">首页</a> » <?php echo esc_html( get_search_query() ); ?> 的搜索结果
</div>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2 class="post-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></h2>
<div class="post-excerpt">
<?php
if(preg_match('/<!--more.*?-->/',$post->post_content)){
the_content('', TRUE);
}else{
if( has_post_thumbnail() ){
echo '<p class="text-center">';
the_post_thumbnail();
echo '</p>';
}
the_excerpt();
}
?>
</div>
<div class="post-meta">
<?php if(is_sticky()) echo '<span class="tj">推荐</span>'; ?>
<span><?php the_time(__('Y年m月j日')) ?></span>
<span><?php the_category(','); ?></span>
<span><?php lmsim_theme_views(); ?> 浏览</span>
<span><?php comments_popup_link('0 评论', '1 评论', '% 评论', '', '评论已关闭'); ?></span>
</div>
</div>
<?php endwhile; ?>
<?php the_posts_pagination(); ?>
</nav>
<?php else : ?>
<h2 class="center"><?php _e('Not Found'); ?></h2>
<p class="center"><?php _e('Sorry, but you are looking for something that isn’t here.'); ?></p>
<?php get_search_form(); ?>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>