-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
63 lines (57 loc) · 2.15 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
<?php get_header();
$post_type = $wp_query->get_queried_object();
?>
<div class="container div-archive-container">
<div class="col-sm-8">
<div class="row div-section">
<div class="div-section-title div-archive-section-title">
<div>
<p><i class="fa fa-search" aria-hidden="true"></i> <?php the_search_query(); ?>の検索結果 : <?php echo $wp_query->found_posts; ?>件</p>
</div>
</div>
</div>
<div class="row div-section">
<ul class="list-group">
<?php
if (have_posts()) : // WordPress ループ
while (have_posts()) : the_post(); // 繰り返し処理開始 ?>
<li class="list-group-item">
<a href="<?php the_permalink(); ?>">
<div class="post__content">
<h3 class="post__title"><?php echo mb_substr(get_the_title(), 0, 30); ?></h3>
<p class="post__text"><?php echo mb_substr(strip_tags($post->post_content), 0, 60) . "..."; ?></p>
<p class="post__info">by <?php the_author(); ?> | <?php the_time('Y年n月j日'); ?></p>
</div>
</a>
</li>
<?php
endwhile; // 繰り返し処理終了
else : // ここから記事が見つからなかった場合の処理
include('no-article.php');
endif;
?>
<!-- pager -->
<?php
if ($myQuery->max_num_pages > 1) : ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« PREV'); ?></div>
<div class="alignright"><?php previous_posts_link('NEXT »'); ?></div>
</div>
<?php
endif;
?>
</ul>
</div>
</div>
<div class="col-md-4 div-single-widget">
<?php get_sidebar(); ?>
</div>
</div>
<!-- Main Content -->
<div class="main__content">
</div>
<!-- /MainContent -->
<div class="main__sidebar">
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>