質問編集履歴

1

情報の追加

2017/10/04 13:41

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -51,3 +51,65 @@
51
51
  回答をお待ちしております。
52
52
 
53
53
  宜しくお願い致します。
54
+
55
+
56
+
57
+
58
+
59
+ *追記
60
+
61
+ ```PHP
62
+
63
+ <h2>レビュー</h2>
64
+
65
+ <?php if(have_comments()): ?>
66
+
67
+ <ul>
68
+
69
+ <?php
70
+
71
+ $comments = get_comments(array(
72
+
73
+ 'status' => 'approve',
74
+
75
+ 'number' => 4 //四件表示
76
+
77
+ ));
78
+
79
+ foreach ($comments as $comment) {?>
80
+
81
+ <li>
82
+
83
+ <h3><?php the_title(); ?></h3>
84
+
85
+ <p><?php comment_author(); ?></p>
86
+
87
+ <p><?php echo mb_substr(get_comment_excerpt(), 0, 30); ?></p>
88
+
89
+ <a href="#">続きを読む</a>
90
+
91
+ </li>
92
+
93
+ <?php };?>
94
+
95
+ </ul>
96
+
97
+ <?php else : ?>
98
+
99
+ <p>まだ投稿されていません。</p>
100
+
101
+ <?php endif; ?>
102
+
103
+ </div>
104
+
105
+
106
+
107
+ <?php comment_form(); ?>
108
+
109
+
110
+
111
+ ```
112
+
113
+
114
+
115
+ functions.phpは参考サイトと全く同じです。