$result = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE post_date BETWEEN '$daysago' AND '$today' AND post_status='publish' AND post_type='post' ORDER BY post_date DESC ");
foreach ($result as $Item) {
$post_ID[] = $Item->ID;//Write the published article ID into an array
}
$post_num = count($post_ID);// Output the number of elements in the array, the number of article IDs, that is, the number of published articles
$output .= ''.$post_num.'';//Output the number of articles
echo $output ;
}
Copy code
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn