-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive-info.php
57 lines (56 loc) · 2.7 KB
/
archive-info.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
<?php get_header(); ?>
<main>
<section class="p-subVisual">
<div class="subVisualContainer">
<picture>
<source srcset="<?php echo esc_url(get_theme_file_uri('img/news-sp.jpg')); ?>" media="(max-width: 415px)">
<img src="<?php echo esc_url(get_theme_file_uri('img/news.jpg')); ?>" srcset="<?php echo esc_url(get_theme_file_uri('img/news@2x.jpg')); ?>" alt="サブ画像01">
</picture>
<h1 class="subTitle">お知らせ</h1><!-- /.subTitle -->
</div><!-- /.subVisualContainer -->
<div class="breadList">
<div class="inner breadListContainer breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/">
<?php if(function_exists('bcn_display'))
{
bcn_display();
}?>
</div>
</div><!-- /.breadList -->
</section><!-- /.p-subVisual -->
<section class="p-newsLists">
<div class="inner newsListsContainer">
<h2 class="newListTitle">お知らせ一覧</h2><!-- /.newListTitle -->
<ul class="newsList">
<!-- お知らせ一覧表示 -->
<?php
$args = array(
'paged' => $paged,
'post_type' => 'info',
'posts_per_page' => 10,
);
$the_query = new WP_Query($args);
?>
<?php if($the_query -> have_posts()): ?>
<?php while($the_query -> have_posts()): $the_query -> the_post(); ?>
<li>
<span class="newsDate"><?php echo get_the_date('Y-m-d'); ?></span><!-- /.newsDate -->
<a href="<?php the_permalink(); ?>"><?php my_post_title_str(get_the_title(), 20);; ?></a>
</li>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
</ul><!-- /.newsList -->
</div><!-- /.newsListsContainer -->
</section><!-- /.p-newsLists -->
<!-- ページング -->
<section class="c-pager">
<div class="inner pagerContainer">
<?php
if( function_exists('wp_pagenavi') ) {
wp_pagenavi(array('query' => $the_query));
}
?>
</div><!-- /.pagerContainer -->
</section><!-- /.c-pager -->
<?php get_footer(); ?>
</main>