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
/
Copy pathallposts.php
98 lines (87 loc) · 2.63 KB
/
allposts.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
<?php
/*
* Template Name: all_posts
* すべての投稿を表示するためのテンプレート
*/
get_header();
?>
<article id="content">
<header class="entry-header">
<h1 class="post-title">投稿されたすべてのトピック</h1>
</header>
<?php
$paged = get_query_var('paged');
$posts = query_posts(array("post_type" => array("post"),
"paged" => $paged,
"posts_par_page" => 5,
"meta_key " => $_GET['key'],
"meta_value" => $_GET['value'],
"orderby" => "date"));
$isList = isset($_GET["list"]);
?>
<?php
if(have_posts()) :
foreach ($posts as $post) :
setup_postdata($post);
$the_id = get_the_ID();
?>
<?php
$class = $isList ? 'archive-post list' : 'archive-post';
?>
<article class="<?php echo $class; ?>">
<header class="archive-post_header">
<?php
//post_icon(get_the_ID(),array(70,70));
?>
<h1 class="archive-post-title">
<?php
/*
* article's title
*/
$permaLink = get_permalink();
$titleText = get_the_title();
echo '<a href="'. esc_attr($permaLink) .'">'. esc_html($titleText) .'</a>';
?>
</h1>
<?php
edit_the_link($the_id);
?>
</header>
<footer class="meta-container">
<div class="postmeta-project">
<?php
the_project_list_of_the_post($the_id);
?>
</div>
</footer>
<?php if(!$isList): ?>
<div class="entry-body">
<?php the_content() ?>
</div>
<?php endif; ?>
<footer class="entry-footer">
<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 navigation_bar(); ?>
</nav>
</article>
<?php get_footer(); ?>