WordPress函数:have_posts
一、函数简介
循环。循环后控制。(The Loop. Post loop control.)
二、函数参数
三、函数案例
四、源代码
/*
* The Loop. Post loop control.
*/
/**
* Determines whether current WordPress query has posts to loop over.
*
* @since 1.5.0
*
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool True if posts are available, false if end of the loop.
*/
function have_posts() {
global $wp_query;
if ( ! isset( $wp_query ) ) {
return false;
}
return $wp_query->have_posts();
}
THE END