全部の記事数の取得は何とか出来たのですが・・・
この記事の中から今日投稿された記事数を取得させたいいです。
AND post_date > now()を後ろに追加してみたのですがうまく行きませんでした。
よろしくお願い致します
以下全記事数取得コード
php
1<?php $numposts = $wpdb->get_var("SELECT count(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'news’"); 2if (0 < $numposts) 3 $numposts = number_format($numposts); 4echo '<p>ニュースの全記事数: '. $numposts .'件</p>'; 5?>
以下最新記事数取得コード
php
1<?php $numposts = $wpdb->get_var("SELECT count(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'news’"); 2if (0 < $numposts) 3 $numposts = number_format($numposts); 4echo '<p>ニュースの全記事数: '. $numposts .'件</p>'; 5?>
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/07/20 14:12