This repository has been archived by the owner on Dec 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
97 lines (92 loc) · 2.52 KB
/
index.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
<?php
/*
* modestのトップページを編集するときに必要
*/
/*
Template Name: index
*/
get_header();
?>
<article id="content">
<section id="hottopic">
<h2 class="topsection-title">注目トピック</h2>
<div id="hottopic-list">
<?php
$cat = get_category_by_slug('hot');
$cat = $cat->term_id;
$posts = get_posts("order=desc&category=". $cat ."&numberposts=3");
if($posts):
foreach($posts as $post):
setup_postdata($post);
?>
<h3 class="hottopic-item">
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
<?php the_title(); ?>
</a>
</h3>
<?php
endforeach;
endif;
?>
</div>
</section>
<section id="blogfeed">
<h2 class="topsection-title">最新のトピック</h2>
<?php
$posts = get_posts('posts_per_page=5');
if($posts):
foreach($posts as $post):
setup_postdata($post);
$the_id = get_the_ID();
?>
<article class="feed-article">
<header>
<h1 class="feed-article-title">
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
<?php the_title(); ?>
</a>
</h1>
</header>
<footer>
<div class="postmeta-project">
<?php
the_project_list_of_the_post($the_id);
?>
</div>
<div class="postmeta">
<p class="postmeta-title">投稿者</p>
<address class="postmeta-content author">
<?php
the_author_post_link_with_avatar();
?>
</address>
<p class="postmeta-title">投稿日時</p>
<div class="postmeta-content">
<?php
the_time_of_the_post($the_id);
?>
</div>
</div>
</footer>
</article>
<?php
endforeach;
endif;
?>
<nav class="navigation">
<?php
$allpost_link = get_all_post_url();
$allpost_link_title = $allpost_link . '?list';
?>
<ul class="navigation-list">
<li class="navigation-list-item">
<a class="navigation-list-item-link" href="<?php echo $allpost_link; ?>">すべてのトピック</a>
</li>
<li class="navigation-list-item">
<a class="navigation-list-item-link" href="<?php echo $allpost_link_title; ?>">すべてのトピック(タイトルのみ)</a>
</li>
</ul>
</nav>
</section>
</article>
<?php get_footer(); ?>