質問編集履歴
1
シングルクオートが抜けていたので修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
以下全記事数取得コード
|
9
9
|
```php
|
10
|
-
<?php $numposts = $wpdb->get_var("SELECT count(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'news");
|
10
|
+
<?php $numposts = $wpdb->get_var("SELECT count(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'news’");
|
11
11
|
if (0 < $numposts)
|
12
12
|
$numposts = number_format($numposts);
|
13
13
|
echo '<p>ニュースの全記事数: '. $numposts .'件</p>';
|
@@ -15,7 +15,7 @@
|
|
15
15
|
```
|
16
16
|
以下最新記事数取得コード
|
17
17
|
```php
|
18
|
-
<?php $numposts = $wpdb->get_var("SELECT count(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'news");
|
18
|
+
<?php $numposts = $wpdb->get_var("SELECT count(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'news’");
|
19
19
|
if (0 < $numposts)
|
20
20
|
$numposts = number_format($numposts);
|
21
21
|
echo '<p>ニュースの全記事数: '. $numposts .'件</p>';
|