这是否可行?
对
<小时>get_posts();
是你最好的朋友。无需修改查询或运行新查询。
// Call it with the date you need as input argument
function wpse28632_get_daily_posts( $date = null )
{
$posts = get_posts( array( \'order_by\' => \'post_date\' ) ); // additional arguments - see Codex
echo \'<ul>\';
foreach ( $posts as $post )
{
if ( $date == $post->post_date )
echo "<li>{$post}</li>";
}
echo \'</ul>\';
}