質問編集履歴

3

タイトルに誤字

2016/08/24 03:36

投稿

ShogoChicago
ShogoChicago

スコア38

test CHANGED
@@ -1 +1 @@
1
- 【WordPress】承認待ちのコメントが掲載されてしまう
1
+ 【WordPress】承認待ちのコメントが掲載されてしまう
test CHANGED
File without changes

2

コードを追記しました

2016/08/24 03:36

投稿

ShogoChicago
ShogoChicago

スコア38

test CHANGED
@@ -1 +1 @@
1
- 【WordPress】承認待ちのコメントが掲載されてしまう
1
+ 【WordPress】承認待ちのコメントが掲載されてしまう
test CHANGED
@@ -17,3 +17,127 @@
17
17
  どの部分を修正すればよいか思い当たる方がおりましたら、アドバイスをお願い致します。
18
18
 
19
19
  ![ディスカッションの設定](b45759b8936ed360d1672f284a8651db.png)
20
+
21
+
22
+
23
+ #【追記】コード
24
+
25
+ ```PHP
26
+
27
+ 【single.phpのコメント部分】
28
+
29
+ <?php if ( has_category( 'service' )or has_category( 'popular' )): ?>
30
+
31
+ <!--------------CommentArea--------------->
32
+
33
+ <div class="col-full">
34
+
35
+ <div class="wrap-col">
36
+
37
+ <?php comments_template( ); ?>
38
+
39
+ </div><!-- ^ .wrap-col END-->
40
+
41
+ </div><!-- ^ .col-full END-->
42
+
43
+
44
+
45
+ <!--------------CommentArea END--------------->
46
+
47
+ <?php endif; ?>
48
+
49
+ ```
50
+
51
+
52
+
53
+ ```PHP
54
+
55
+ 【comments.php】
56
+
57
+ <div id="comment_area">
58
+
59
+ <div class="comment_post">
60
+
61
+
62
+
63
+ <?php $args = array(
64
+
65
+ 'title_reply' => '口コミを投稿する',
66
+
67
+ 'label_submit' => '口コミを送信する',
68
+
69
+ 'fields' => array(
70
+
71
+ 'author' => '<p class="comment-form-author">' .
72
+
73
+ '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' placeholder="*お名前" /></p>',
74
+
75
+ ),
76
+
77
+ 'comment_field' => '<p class="comment-form-comment">' . '<textarea id="comment" name="comment" cols="50" rows="6" aria-required="true"' . $aria_req . ' placeholder="*口コミの内容" /></textarea></p>',
78
+
79
+ );
80
+
81
+ comment_form( $args ); ?>
82
+
83
+ </div>
84
+
85
+ <div class="posted_comments">
86
+
87
+ <?php if(have_comments()): ?>
88
+
89
+ <h3 id="comments">投稿された口コミ</h3>
90
+
91
+ <div class="comments-list">
92
+
93
+
94
+
95
+ <?php $comments_per_page = 10;
96
+
97
+ $comments = get_comments( array( 'status' => 'approve' , 'post_id' => $post->ID) );
98
+
99
+ ?>
100
+
101
+ <?php wp_list_comments( array (
102
+
103
+ 'per_page' => $comments_per_page,
104
+
105
+ 'reverse_top_level' => false
106
+
107
+ ), $comments ); ?>
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+ </div>
116
+
117
+ <?php endif; ?>
118
+
119
+ </div>
120
+
121
+ </div>
122
+
123
+
124
+
125
+
126
+
127
+ <?php if(get_comment_pages_count() > 1) : ?>
128
+
129
+ <div>
130
+
131
+ <?php previous_comments_link('次のコメント'); ?>
132
+
133
+ <?php next_comments_link('前のコメント'); ?>
134
+
135
+ </div>
136
+
137
+ <?php endif; ?>
138
+
139
+
140
+
141
+
142
+
143
+ ```

1

タイトルがわかりにくかったので修正

2016/08/24 03:23

投稿

ShogoChicago
ShogoChicago

スコア38

test CHANGED
@@ -1 +1 @@
1
- 【WordPress】コメントを承認していないのに掲載されてしまう
1
+ 【WordPress】承認待ちのコメント掲載されてしまう
test CHANGED
File without changes