我认为你在正确的道路上posts_where
, 像这样的方法应该会奏效:
<?php
function my_filter_where($where){
global $my_current_id;
$where .= " AND ID >= ".$my_current_id;
return $where;
}
// random number I chose for sake of example
$my_current_id = 30;
add_filter(\'posts_where\', \'my_filter_where\');
$my_posts = new WP_Query("posts_per_page=5&orderby=ID&order=ASC");
remove_filter(\'posts_where\', \'my_filter_where\');