以下代码是将所有定时文章延长8小时执行,你想具体延时多少就把秒数改一下。
$args = array(
'post_status' => 'future',
);
$query = new WP_Query( $args );
foreach ( $query->posts as $post ) {
wp_clear_scheduled_hook( 'publish_future_post', array( $post->ID ) );
wp_schedule_single_event( strtotime( $post->post_date ) + 28800, 'publish_future_post', array( $post->ID ) );
}
以后提问千万把问题描述清楚,否则不利于搜索引擎索引,尤其是对于这种需要定制代码来实现的需求就使得付出的成本和收到的回报相差颇多了。