回答編集履歴

1

情報の追加。

2016/06/25 12:42

投稿

kei344
kei344

スコア69442

test CHANGED
@@ -3,3 +3,39 @@
3
3
  <li>[star_img]<span class="num"><?php comments_number(); ?>件の評価</span></li>
4
4
 
5
5
  ```では?
6
+
7
+
8
+
9
+ ---
10
+
11
+
12
+
13
+ **追記:**
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+ 下記をfunction.phpに追加して、テンプレートで `<?php get_my_comment_count(); ?>` としてみてください。
22
+
23
+ ```PHP
24
+
25
+ if ( ! function_exists( 'get_my_comment_count' ) ) :
26
+
27
+ function get_my_comment_count() {
28
+
29
+ global $wp_query;
30
+
31
+ echo ( is_single() && isset( $wp_query->post ) ) ? $wp_query->post->comment_count : '';
32
+
33
+ }
34
+
35
+ endif; // if ( ! function_exists( 'get_my_comment_count' ) )
36
+
37
+ ```
38
+
39
+
40
+
41
+ あと、テンプレートの編集中はデバックモードにされたほうが問題解決が早くなります。