-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive-blog.php
213 lines (198 loc) · 9.25 KB
/
archive-blog.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?php get_header(); ?>
<?php wp_link_pages(); ?>
<script type="text/javascript">
$(function(){
$('.div-section img').css('opacity','0');
$('.div-section img').on('inview',function(event, isInView, visiblePartX, visiblePartY){
var target = $(this);
setTimeout(function(){
if(isInView){
target.stop().animate({
opacity:1
},500);
}else{
}
},500);
});
});
</script>
<div class="container div-archive-container">
<div class="row div-section">
<div class="div-section-title div-archive-section-title">
<div>
<p><i class="fa fa-newspaper-o" aria-hidden="true"></i> ブログ</p>
</div>
</div>
<div class="div-archive-section-recent">
<?php
$myQuery = new WP_Query();
$param = array(
'paged' => 0,
'posts_per_page' => '1',
'post_type' => array('blog'),
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC',
'offset' => '0'
);
$myQuery->query($param);
if ($myQuery->have_posts()) :
while ($myQuery->have_posts()) : $myQuery->the_post(); ?>
<div class="col-sm-6">
<a href="<?php the_permalink(); ?>">
<img class="img-archive-recent-thumbnail" src="<?php echo get_thumbnail_url(has_post_thumbnail()) ?>" alt="">
</a>
</div>
<div class="col-sm-6">
<a href="<?php the_permalink(); ?>">
<p class="p-archive-top-title"><?php echo get_the_title() ?></p>
<p class="p-home-section-recent-date"><?php the_time('Y/n/j'); ?></p>
</a>
<p><?php echo mb_substr(get_the_content(),0,200); ?></p>
</div>
<?php
endwhile; // 繰り返し処理終了
else : // ここから記事が見つからなかった場合の処理
include('no-article.php');
endif;
?>
</div>
<div class="div-archive-section-recent">
<?php
$myQuery = new WP_Query();
$param = array(
'paged' => 0,
'posts_per_page' => '2',
'post_type' => array('blog'),
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC',
'offset'=>'1'
);
$myQuery->query($param);
if ($myQuery->have_posts()) :
while ($myQuery->have_posts()) : $myQuery->the_post(); ?>
<div class="col-sm-6 a-archive-subrecent">
<a href="<?php the_permalink(); ?>">
<img class="img-archive-recent-thumbnail" src="<?php echo get_thumbnail_url(has_post_thumbnail()) ?>" alt="">
<div>
<p class="p-home-section-recent-date"><?php the_time('Y/n/j'); ?></p>
<p class="p-archive-sub-title"><?php echo mb_substr(get_the_title(), 0, 100); ?></p>
</div>
</a>
</div>
<?php
endwhile; // 繰り返し処理終了
else : // ここから記事が見つからなかった場合の処理
include('no-article.php');
endif;
?>
</div>
<div class="div-archive-section-recent">
<?php
$myQuery = new WP_Query();
$param = array(
'paged' => 0,
'posts_per_page' => '3',
'post_type' => array('blog'),
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC',
'offset'=>'3'
);
$myQuery->query($param);
if ($myQuery->have_posts()) :
while ($myQuery->have_posts()) : $myQuery->the_post(); ?>
<div class="col-sm-4 a-archive-subrecent">
<a href="<?php the_permalink(); ?>">
<img class="img-archive-recent-thumbnail" src="<?php echo get_thumbnail_url(has_post_thumbnail()) ?>" alt="">
<div>
<p class="p-home-section-recent-date"><?php the_time('Y/n/j'); ?></p>
<p class="p-archive-sub-title"><?php echo mb_substr(get_the_title(), 0, 100); ?></p>
</div>
</a>
</div>
<?php
endwhile; // 繰り返し処理終了
else : // ここから記事が見つからなかった場合の処理
include('no-article.php');
endif;
?>
</div>
<div class="div-archive-section-recent">
<?php
$myQuery = new WP_Query();
$param = array(
'paged' => 0,
'posts_per_page' => '3',
'post_type' => array('blog'),
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC',
'offset'=>'6'
);
$myQuery->query($param);
if ($myQuery->have_posts()) :
while ($myQuery->have_posts()) : $myQuery->the_post(); ?>
<div class="col-sm-4 a-archive-subsubrecent">
<a href="<?php the_permalink(); ?>">
<img class="img-archive-recent-thumbnail" src="<?php echo get_thumbnail_url(has_post_thumbnail()) ?>" alt="">
<div>
<p class="p-home-section-recent-date"><?php the_time('Y/n/j'); ?></p>
<p class="p-archive-sub-title"><?php echo mb_substr(get_the_title(), 0, 100); ?></p>
</div>
</a>
</div>
<?php
endwhile; // 繰り返し処理終了
else : // ここから記事が見つからなかった場合の処理
include('no-article.php');
endif;
?>
</div>
<div class="div-archive-section-recent">
<?php
$myQuery = new WP_Query();
$param = array(
'paged' => 0,
'posts_per_page' => '3',
'post_type' => array('blog'),
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC',
'offset'=>'9'
);
$myQuery->query($param);
if ($myQuery->have_posts()) :
while ($myQuery->have_posts()) : $myQuery->the_post(); ?>
<div class="col-sm-4 a-archive-subsubrecent">
<a href="<?php the_permalink(); ?>">
<img class="img-archive-recent-thumbnail" src="<?php echo get_thumbnail_url(has_post_thumbnail()) ?>" alt="">
<div>
<p class="p-home-section-recent-date"><?php the_time('Y/n/j'); ?></p>
<p class="p-archive-sub-title"><?php echo mb_substr(get_the_title(), 0, 100); ?></p>
</div>
</a>
</div>
<?php
endwhile; // 繰り返し処理終了
else : // ここから記事が見つからなかった場合の処理
include('no-article.php');
endif;
?>
</div>
</div>
</div>
<div class="navigation">
<?php
if (get_previous_posts_link()): ?>
<div class="align-left"><?php previous_posts_link('« %title'); ?></div>
<?php
endif;
if (get_next_posts_link()): ?>
<div class="align-right"><?php next_posts_link('%title »'); ?></div>
<?php
endif;
?>
</div>
<?php get_footer(); ?>